Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: alternating row colors

by Russ (Deacon)
on May 18, 2001 at 01:02 UTC ( [id://81371] : note . print w/replies, xml ) Need Help??

in reply to alternating row colors

I like to use something like this:
my @BGColors = ('#dddddd', '#ffffff'); for (1..10){ # As you loop through a database query result or somethin +g print qq{ <tr bgcolor="$BGColors[$flip = !$flip]"> <td>$_</td> </tr> }; }
Also, see Flipper for more discussion about this kind of thing.

Brainbench 'Most Valuable Professional' for Perl