How do you do one row a light colour then the next a dark colour?????
when you just looping a row?
$i = 1; while($row = mysql_fetch_array($result)) { $color = (($i % 2) == 0) ? 'red' : 'green'; echo '<td bgcolor='.$color.'>'.$row['data'].'</td>'."\n"; $i++; }
$clr[0]='light'; $clr[1]='dark'; while( in loop, declaring table rows){ i++; //counter ?> <tr style="background-color:<?php echo $clr[fmod($i,2)]?>"> etc.. </tr> <?php }
Originally posted by sfullman $clr[0]='light'; $clr[1]='dark'; while( in loop, declaring table rows){ i++; //counter ?> <tr style="background-color:<?php echo $clr[fmod($i,2)]?>"> etc.. </tr> <?php } [/B]
Originally posted by sfullman
[/B]
that get a phase error!!