here's one way, set a variable and switch it on and off



$tr_properties = 'style="background-color: grey;"';
while(  $ect =  etc   ) {
     if($tr_properties){
         print "<tr $tr_properties>";
        $tr_properties = false;
     } else {
         print "<tr>";
        $tr_properties = 'style="background-color: grey;"';
     }
}

you sould refine the code and simplify it but that is basic principle.

joshua


Christopher J. Crane wrote:
> How do you alternate colors of the rows in a table inside a while statement
> when dealing with the output of data from a DB. I am sure it's something
> simple but I keep getting into some really long math thing...
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to