CSS query results
Posted: Mon Feb 19, 2007 12:49 pm
The Ninja Space Goat | Please use
Thanks for any info,
Slash.
The Ninja Space Goat | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I'm doing a simple query and using a while to echo the results to a table and was wondering how i can set row1 to have say a red background and row2 to be blue. I know how to do the CSS bit just not the php code. In a nutshell i'd like all even number rows to be red all odds to be blue, any one know how i would code this? Here's what i've got so far:Code: Select all
<?php
while($row = mysql_fetch_array($result))
{
echo "<table border=1>".
"<tr>".
"<th>Horse</th>".
"<th>Course</th>".
"<th>Time</th>".
"<th>Last Backed</th>".
"</tr>".
"<tr>".
"<td>{$row['Name']}</td>".
"<td>{$row['Date']}</td>".
"<td>{$row['Time']}</td>".
"</tr>".
"<tr>".
"</table><br>";
}
?>Slash.
The Ninja Space Goat | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]