Re: [PHP-DB] Table question....
if you mean the rows switching colors i use this. in this example i'm getting data from mysql $rs = 0; for($i = 0; $i count($rs); ) { while ($rs = mysql_fetch_array($result)) { $bgcolor = ($i % 2) ? 'blue' : 'black'; //do stuff $i++; } } then $bgcolor goes in each td bgcolor=$bgcolor ... hth jd Rodrigo rodrigo@praticsistem To: PHP [EMAIL PROTECTED] as.com.br cc: Subject: [PHP-DB] Table question 10/03/2002 08:59 AM Please respond to Rodrigo Hi people, is there a way to print a table with the background switching colors??? like one blue, the next black, blue, black... thanks in advance... Equipe Pratic Sistemas Rodrigo Corrêa Fone: (14) 441-1700 [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Table question....
you have to make it yourself... make a counter, for every row do $counter++; and the if ($counter%2==0){ blue }else{ red } the % is the difference math function... you got a rest-value or not... hope you get it :) -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: donderdag 3 oktober 2002 14:30 To: PHP Subject: [PHP-DB] Table question Hi people, is there a way to print a table with the background switching colors??? like one blue, the next black, blue, black... thanks in advance... Equipe Pratic Sistemas Rodrigo Corrêa Fone: (14) 441-1700 [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Table question....
$bgcolor = ($count++ 1) ? blue : black; Then use $bgcolor in your tr ---John Holmes... - Original Message - From: Rodrigo [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, October 03, 2002 8:29 AM Subject: [PHP-DB] Table question Hi people, is there a way to print a table with the background switching colors??? like one blue, the next black, blue, black... thanks in advance... Equipe Pratic Sistemas Rodrigo Corrêa Fone: (14) 441-1700 [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php