In the generated HTML produced by your WHILE statement you can alternate 
colours. Here's one approach ... the code is bounded by table tags not seen 
here, the query has been executed and assigned to $result:
while( $row = mysql_fetch_array( $result ) )
{
     if( ( $nCounter++ % 2 ) == 0 )
         { echo "<tr bgcolor=\"green\" >"; }
         else
         { echo "<tr bgcolor=\"##CCCC33\" >"; }
     echo "<td>", $row[ no], "</td><td>", $row[ date], "</td><td>", 
number_format ($row[ yBidAmount ], 2, "," , " " ), "</td></tr>";
}

Even rows are green, and odd rows are whatever that other colour is, a 
deeper green I believe. Now, you may not like my choice of colours, but I 
was experimenting. The client settled on white and gray. Sigh.

Miles

At 10:57 AM 8/29/01 -0700, Alnisa Allgood wrote:
>I'm not certain if this is more an HTML question or a PHP issue, but...
>
>I'm creating an account management system, where each client can have 
>multiple accounts, each account can have multiple users, and each user can 
>make multiple requests.
>
>I've created a SQL Query that returns a list of all user requests, based 
>on userID. I'd like to format the display so that it looks like:
>
>(white)  $no   $date     $subject                         $priority $status
>(grey)    $no   $date     $subject                         $priority $status
>
>how do I tell php to switch the background color of a row in a table, 
>automatically?
>
>Alnisa
>--
>   .........................................
>    Alnisa  Allgood
>    Executive Director
>    Nonprofit Tech
>    (ph) 415.337.7412  (fx) 415.337.7927
>    (url)  http://www.nonprofit-techworld.org
>    (url)  http://www.nonprofit-tech.org
>    (url)  http://www.tech-library.org
>   .........................................
>    Nonprofit Tech E-Update
>    mailto:[EMAIL PROTECTED]
>   .........................................
>    applying technology to transform
>   .........................................
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to