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>'; ?> Link to comment https://forums.phpfreaks.com/topic/183331-alternating-background-colors/ Share on other sites More sharing options...
justAnoob Posted November 29, 2009 Author Share Posted November 29, 2009 Got it, sorry. Link to comment https://forums.phpfreaks.com/topic/183331-alternating-background-colors/#findComment-967675 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.