Results 1 to 9 of 9
Apr 15, 2002, 18:14 #1
TOGGLE... alternating row colours, HOW??
Ok I'm pulling some rows from MySql, and I'm putting each row in a HTML table row. I basically want to alternate the rows' background colour, so row one will be for ex. blue, row two green, row three blue again, and so on...
I've set up variables for all the bgcolor tags, but what I can't figure out is how to toggle these variables between two value sets every time my while loop runs.
What I tried is:
if($toggle=1): $toggle=2; $dkcolour = "#669900"; $ltcolour = "#99FF00"; $hr = $hrclass; elseif($toggle=2): $toggle=1; $dkcolour = "#006666"; $ltcolour = "#0099FF"; $hr = $hrclass; endif;