Jump to content

alternating background colors


justAnoob

Recommended Posts

I have a table that is populated from a database. Right now the background color is D3E0EC. My question is how could I have the rows alternated colors from D3E0EC and FFFFFF ?

 

<?php
while ($row = mysql_fetch_array($sql))
{
echo '<table width="705" border="0" cellspacing="0" id="first" bgcolor="#D3E0EC">';
echo '<tr>';
echo '<li>';
echo '<td width="323">';
echo '<a href="#" class="style10" onclick="clicked(\'' . $row['item_name'] . '\')">' . $row['item_name'] . '</a>';
echo '</td>';
echo '<td width="100"><div align="center"><form id="form3" name="form3" method="post" action="delete.php">';
echo '<input type="submit" name="submit" class="style10" style="cursor: pointer; border: 0; background-color: #D3E0EC;" id="submit" value="X" /></form></div></td>';
echo '<td width="75"><div align="center" class="style10">55</div></td>';
echo '<td width="131"><div align="center" class="style10">07-19-2009</div></td>';
echo '</tr>';
echo '</table>';
echo '</li>';
?>

Link to comment
https://forums.phpfreaks.com/topic/183331-alternating-background-colors/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.