justAnoob Posted November 29, 2009 Share Posted November 29, 2009 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>'; ?> Quote Link to comment Share on other sites More sharing options...
justAnoob Posted November 29, 2009 Author Share Posted November 29, 2009 Got it, sorry. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.