in reply to Conditional color formatting ---- HTML
# My requirement is to set a different background color # to rows depending on the "IF" conditions they satisfy. # Please help,what is the correct syntax while (my $line = <$IN>) { if ($line =~ /.*MATCH.*/) { $ret .= "<tr><td style='background-color:orange'>$line </td></tr>\ +n"; } else { $ret .= "<tr>$line </tr>\n"; } } close $IN; return $ret;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Conditional color formatting ---- HTML
by Anonymous Monk on Aug 22, 2018 at 22:57 UTC |