Bonjour tout le monde,
Je génère un tableau en PHP.
Étrangement, le nom des en-têtes sont décalés d'une cellule vers la droite (voir image attachée à ce message).
Voici mon code :
Voyez-vous ce qui ne va pas ?
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 echo '<table border="1" width="80%" border="10" cellpadding="0"> <tr> <th> <td height="10" width="100">LUNDI</td> <td height="10" width="100">MARDI</td> <td height="10" width="100">MERCREDI</td> <td height="10" width="100">JEUDI</td> <td height="10" width="100">VENDREDI</td> <td height="10" width="100">SAMEDI</td> <td height="10" width="100">DIMANCHE</td> </th> </tr> <tr>'; for($i = 1; $i <= $nombrejour; $i++) { //si le modulo de i par 6 est égal à 0, j'ajoute une ligne (<tr>) echo '<td height="100" width="100">'.$i.'</td>'; if($i%7==0) { echo '<tr></tr>'; } } echo ' </tr> </table>';
Merci d'avance.
beegees
Partager