Page 1 of 1

Dynamic Table row bgcolors?

Posted: Fri Jun 04, 2004 1:31 pm
by jonas
How would you make say the following code have different row bgcolors?

Like the first row displayed would be white, the second would be grey and the third would be back to white...

Let's use this code as an example:

Code: Select all

$query = "SELECT * FROM systems";
	$mysql_stuff = mysql_query($query, $mysql_link);
	while($roc = mysql_fetch_row($mysql_stuff)){
		$systemID = $rocї0];
		$system_name = $rocї1];
		print("<tr><td><div align="center"><a href="editagame-sys.php?systemID=$systemID" target="main">$system_name</a></div></td></tr>");
	&#125;
So I want the first output to have a lets say white bgcolor and the second to be grey bgcolor and the third would be back to white.

What's the best way to achieve this?

Posted: Fri Jun 04, 2004 1:33 pm
by magicrobotmonkey

Posted: Fri Jun 04, 2004 1:35 pm
by jonas
Yes! Not only have you given me my answer, but you are a robot monkey!

Posted: Fri Jun 04, 2004 2:08 pm
by magicrobotmonkey
a magical robot monkey! wooo ooo ooooo!