question about tables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

question about tables

Post by bla5e »

Code: Select all

<table border=0 bgcolor="#222222" width=390 align=left cellpadding=3 cellspacing=0>
<tr><td width=100><img src="images/m_opponent.gif">
</td><td align=center><img src="images/m_date.gif">
</td><td align=center><img src="images/m_map.gif">
</td><td align=center><img src="images/m_outcome.gif">
</td><td align=center><img src="images/m_league.gif">
</td></tr>
</td><td bgcolor="#444444"> 
</td><td bgcolor="#444444" align=center> 
</td><td bgcolor="#444444" align=center> 
</td><td bgcolor="#444444" align=center>
</td><td bgcolor="#444444" align=center> 
</td></tr>
</td><td bgcolor="#333333"><font color="#679BDB"> 
</td><td bgcolor="#333333" align=center> 
</td><td bgcolor="#333333" align=center> 
</td><td bgcolor="#333333" align=center> 
</td><td bgcolor="#333333" align=center> 
</td></tr>

</table>
as you can see from my HTML code, every other column is #333333, how do i get this affect to happen with mySQL data fetch?

i know the mysql date fetch code.. but how do i get it to make every other column a different color
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Code: Select all

$i=0;

while($info = mysql_fetch_assoc($query))
{
    $i++;

    if ($i==0)
        //color is 4's
    else
        //color is 3's and then change $i back to 0
}
is the idea without the complete code
Post Reply