Bonjour,
Voici quelque jours que j'essaye de faire alterner les couleurs dans mon tableau.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
echo "<table >
<tr>
<th>Numero de commande</th>
<th>Date de Commande</th>
<th>Date Livraison demandée</th>
<th>N° Article</th>
<th>Qté Commandé</th>
<th>Qté Livré</th>
<th>Qte restant à livrer</th>
<th>Unit Price</th>
<th>MT en Commande</th>
<th>Origine Commande</th>
<th>N° Document Origine</th>
<th>AvailableDate</th>
<th>Disponibilité</th>
</tr>";
 
 
 
while($row = mysqli_fetch_array($result)) {
 
    echo "<tr >";
    echo "<td width=7%>" . $row['N° Commande'] . "</td>";
    echo "<td width=5%>" . $row['Date Commande'] . "</td>";
    echo "<td width=6%>" . $row['Date Livraison demandée'] . "</td>";
    echo "<td align=center>" . $row['N° Article'] . "</td>";
    echo "<td align=center width=1%>" . $row['Qté Commandé'] . "</td>";
	echo "<td align=center width=3%>" . $row['Qté Livré'] . "</td>";
    echo "<td align=center width=3%>" . $row['Qte restant à livrer'] . "</td>";
    echo "<td align=center>" . $row['Unit Price'] . "</td>";
    echo "<td  align=center width=5%>" . $row['MT en Commande'] . "</td>";
	echo "<td align=center>" . $row['Origine Commande'] . "</td>";
    echo "<td width=10%>" . $row['N° Document Origine'] . "</td>";
	echo "<td width=5%>" . $row['AvailableDate'] . "</td>";
	echo "<td  align=center width=8% style=\"background-color: ";
	if($row['Disponibilité'] == 'Réapro en cour') {
		echo 'orange';
	} elseif($row['Disponibilité'] == 'En stock') {
		echo 'green';
	} elseif($row['Disponibilité'] == 'Epuisé') {
		echo 'red';
	}
	echo '">'. $row['Disponibilité'].'</span></td></tr>';
}
 
 
 
 
echo "</table>";
J'ai essayé tout un tas de tuto sur openclass room mais ca ne fonctionne jamais.

Auriez vous un début d'idée ?
Merci beaucoup