I'm looking to alternate row colors using PHP function. Here's what I have (although it does not work):
function row($year) {
if($year%2)
$color == "#FFF";
else
$color == "#000";
}
for ($year=2013; $year<=2023; $year++)
{
row($year);
echo "<tr bgcolor='$color'><td>$year</td><td>$tdate</td></tr>";
}
Basically, if a year is odd I would like the color of the row to be white. If even, black.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…