$bgcolor1 = "#BOBOBO"; $bgcolor2 = "#B7DFF7"; print "<TABLE>\n"; while( @data = $query->fetchrow ) { foreach $line(@data) { if ($bgcount > 1) { $bgcolor=$bgcolor2;$bgcount=1; } else { $bgcolor=$bgcolor1;$bgcount=2; } print "<TR bgcolor=$bgcolor> <td width=50 align=left>$data[1]</td> <td width=50 align=left>$data[2]</td> <td width=50 align=left>$data[3]</td> <td width=50 align=left>$data[4]</td> </TR>"; } } print "</TABLE>\n";
In reply to Re: alternating row colors
by Anonymous Monk
in thread alternating row colors
by qball
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |