identifying whether a number is odd or even
Posted: Mon Sep 18, 2006 8:26 am
Hi
I am building a table from fields within my database.
If a field is not empty a new row is built in the table:
this works fine but what I want to now do is add alternating row colours to my table, is there an easy way to achieve this?
thanks in advance
I am building a table from fields within my database.
If a field is not empty a new row is built in the table:
Code: Select all
if(!empty($website))
{
print '<tr><td valign="top"><strong>Website:</strong></td><td><a href = "http://'.$website.'" target="_blank">'.$website.'</a></td></tr>';
}
if(!empty($profile))
{
print '<tr><td valign="top"><strong>Company Profile:</strong></td><td>'.$profile.'</td></tr>';
}
if(!empty($specialisations))
{
print '<tr><td valign="top"><strong>Specialisms:</strong></td><td>'.$specialisations.'</td></tr>';
}
if(!empty($training))
{
print '<tr><td valign="top"><strong>Training and consultancy offered:</strong></td><td>'.$training.'</td></tr>';
}thanks in advance