Re: Returning Rows Question

From: Date: Wed, 04 Sep 2002 23:16:55 +0000
Subject: Re: Returning Rows Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-115248@lists.php.net to get a copy of this message
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...


« previous php.general (#115248) next »