[PHP] Making alternate rows of different colour

2003-01-17 Thread Denis L. Menezes
Hello friends. I put the output of the database query in a table. It works fine. Now I have a need to make the alternate rows of a different color. Can someone please help me with the code? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Making alternate rows of different colour

2003-01-17 Thread Rasmus Lerdorf
I put the output of the database query in a table. It works fine. Now I have a need to make the alternate rows of a different color. Can someone please help me with the code? $cols = array('#ff','#00ff00'); $i = 0; while(your_loop_to_output_each_row) { echo 'tr

Re: [PHP] Making alternate rows of different colour

2003-01-17 Thread Chris Hayes
At 09:05 17-1-2003, you wrote: I put the output of the database query in a table. It works fine. Now I have a need to make the alternate rows of a different color. Can someone please help me with the code? $cols = array('#ff','#00ff00'); $i = 0;

Re: [PHP] Making alternate rows of different colour

2003-01-17 Thread Marek Kilimajer
while($row=mysql...) { $color=($color=='red' ? 'blue' : 'red'); echo ... } Denis L. Menezes wrote: Hello friends. I put the output of the database query in a table. It works fine. Now I have a need to make the alternate rows of a different color. Can someone please help me with the

RE: [PHP] Making alternate rows of different colour

2003-01-17 Thread Daevid Vincent
?php $bgcolor = ($i % 2 == 0) ? BGCOLOR='#E3E3E3' : ; ? TR?=$bgcolor? Can someone please help me with the code? $cols = array('#ff','#00ff00'); $i = 0; while(your_loop_to_output_each_row) { echo 'tr