Bonjour à toutes et à tous !
Voila ! Je suis en IUT info, donc soyez indulgent
Pour faire simple, j'aimerai exploiter mon tableau en php, sous la forme d'un tableau en html. Sauf que je n'arrive pas a afficher les valeurs comme je le souhaite !
Voila un exemple :
Mon tableau => 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
J'aimerais afficher comme ca sous html
0 | 4 | 8
1 | 5 | 9
2 | 6 | 10
3 | 7 |
Et ainsi de suite
Je ne sais pas si je suis clair, c'est un problème d'algo plus que d'affichage. Voila mon code pour le moment....
Je suis un peu coincé ces derniers temps dessus >.<
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
51 <tr> <!-- MES COLONNES --> <td> Enonce des Questions </td> <td> Code Page </td> <td> occBadRep </td> <?php $cptAffTypes = 0; //Pour TITRE du tableau while($cptAffTypes < $cptLesTypes) { ?> <td><?php echo $arrLesTypes[$cptAffTypes];?></td><!-- LES TYPES --> <?php $cptAffTypes++; } ?> <td> pCBadRep </td> </tr> <?php $cptPrincipalDuWhile = 0; $cptIncSix = 0; $cptMax= 0; while($row = mysqli_fetch_assoc($resuToutesLesQuestions)) { ?> <tr> <td><?php echo $row['Enonce_Question'];?></td> <td><?php echo $row['Code_Page'];?></td> <td><?php echo $arrNbBadRepTotal[$cptPrincipalDuWhile];?></td> <?php $cptBouclePourTypes = 0; //Pour remplir les cases While($cptBouclePourTypes < $cptLesTypes) { ?> <td><?php echo ($arrNbRepFauxParType[$cptIncSix]/$arrNbBadRepTotal[$cptPrincipalDuWhile])*100 ." %"; echo "<br />".$arrNbRepFauxParType[$cptIncSix];//SUIVI DE LA VARIABLE POUR LE TEST?></td> <?php $cptBouclePourTypes++; $cptIncSix++; } ?> <td><?php echo ( $arrNbBadRepTotal[$cptPrincipalDuWhile] / $arrNbRepTotal[$cptPrincipalDuWhile] )*100 ."%";?></td> </tr> <?php if($cptIncSix%$cptLesTypes==0) { $cptPrincipalDuWhile++; }
Bref, si je suis pas clair merci de me demander x)
Je vous remercie pour vos pistes !
Partager