alterner les couleurs d'un tableau
Posté : 21 juin 2006, 16:26
Salut
Voici mon code :
Voilà mon tableau qui affiche les données d'une table de ma base de donnée. J'aimerai alterner les couleurs soit des lignes ou des cases. Je n'ai pas su trouver la bonne solution, je suis bloquée.
Pouvez vous m'aider
Merci
Nancy
Voici mon code :
<table border="0">
<tr>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Numéro d'affiliation</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Photo</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Nom</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Prénom</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Nationalité</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Date de naissance</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Numéro de maillot</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Place sur le terrain</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Buts marqués</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Matches joués</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Carte rouge</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Carte jaune</font></th>
<th bgcolor="#6699CC"><font color ="#C6D1E3">Numéro de matricule de l'équipe</font></th>
</tr>
<?php do { ?>
<tr>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NumAffiliation']; ?></font></th>
<th bgcolor="#CCCCCC" width="144" height="192"><img src="<?php echo $dir.$row_joueurs['PhotoJoueurs']; ?>"></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NomJoueurs']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['PrenomJoueurs']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NationaliteJoueurs']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['DateNaissJoueurs']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NumMaillotJoueurs']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['PlaceTerrainJoueurs']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NbreButsMarques']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NbreMatchesJoues']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NbreCarteRouge']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NbreCarteJaune']; ?></font></th>
<th bgcolor="#CCCCCC"><font color ="#003399"><?php echo $row_joueurs['NumMatricule']; ?></font></th>
</tr>
<?php } while ($row_joueurs = mysql_fetch_assoc($joueurs)); ?>
</table>
Voilà mon tableau qui affiche les données d'une table de ma base de donnée. J'aimerai alterner les couleurs soit des lignes ou des cases. Je n'ai pas su trouver la bonne solution, je suis bloquée.
Pouvez vous m'aider
Merci
Nancy