farveskift mellem table rows - find fejlen?
Jeg vil lave så mine tr skifter farve mellem 2 farver. problemet er, at når jeg ser i kildefilen så skriver den bare col1 og col0 istedet for at sætte farverne ind... hvad er der galt? :-/<table align="center" width="400" border="1" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" valign="top"><tr><td colspan="4"><a href="admin_nyhed_opr.php">Opret Nyhed</a></td></tr>
<? $result = mysql_query("select * from news order by id");
$col0 = "#FF3300";
$col1 = "#000000";
$i=0;
while ($row = mysql_fetch_array($result)) {
++$i;
$col = "col" . $i%2;
?>
<TR bgcolor=<? echo $col; ?>>
<td valign="top" width="42%" height="100%"><p class="text2">
<? echo $row["header"]; ?></p></TD>
<td valign="top" width="40%" height="100%"><p class="text2">
<? echo $row["author"]; ?></p></TD>
<td valign="top" width="18" height="100%"><a href="admin_nyhed_upd.php?id=<? echo $row["id"]; ?>" target="_top">Ret</a></TD>
<td valign="top" width="24" height="100%"><a href="admin_nyhed_del.php?id=<? echo $row["id"]; ?>" target="_top">Slet</a></TD>
</TR>
<?
}
mysql_close();
?>
</TABLE>
