Bonjour, j'essaye de créer un tableau de compétition débutant à partir des 16ème de final.
Je suis arrivé à en faire un s'affichant par ligne :
J'aimerai en créer un mais avec l'affichage opposé, par colonnes.Code:
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 $equ = 16; echo "<div style=\"width:900px;overflow:auto;\">" ."<table width=top align=center border=0>"; for ($i = 1; $i <= $equ / 4 ; $i++ ){ echo "<tr align=center>"; if ($i == 5){$equip1 = 0;$test1 = 16;} if ($i == 4){$equip1 = $equ / 8;$test1 = 8;} if ($i == 3){$equip1 = $equ / 4;$test1 = 4;} if ($i == 2){$equip1 = $equ / 2;$test1 = 2;} if ($i == 1){$equip1 = $equ;$test1 = 1;} for ($j = 1; $j <= $test1; $j++ ){ echo "<td colspan=$equip1>" ."<div style=\"border: #000 1px solid;width:100px;margin-left:5px,margin-right:5px;\">" ."Dom $j Vis" ."</div>" ."</td>"; } echo "<tr align=center>"; } echo "</table><br />" ."</div><br />";
Mais ca ne fonctionne pas du tt, le mauvais code :
Voilà, quelqu'un sait comment je peux faire ?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 $equ = 16; echo "<table width=80% align=center border=1>"; for ($i = 1; $i <= $equ; $i++ ){ echo "<tr align=center>"; for ($j = 1; $j <= 4 ; $j++ ){ if ($j == 1){$equip1 = 2;} if ($j == 2){$equip1 = 4;} if ($j == 3){$equip1 = 8;} if ($j == 4){$equip1 = 16;} echo "<td rowspan=$equip1>$i // $j // $equip1</td>"; } echo "<tr align=center>"; } echo "</table>";
Merci !
