Bonjour à tous,
voilà ce que j'essaie actuellement d'obtenir sur ma page web: un tableau contenant la balise <thead> et <tbody>. L'idée serait tout simplement de faire en sorte que le body de mon tableau déroule (car les lignes sont affichées dynamiquement et il peut y en avoir plusieurs dizaines) mais que le head de mon tableau reste à sa place pour qu'à chaque colonne on puisse toujours associer un titre...
Code html : 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 <div id='ascenseur'> <table> <thead> <tr> <th id="interrogation"><div>Ordre</div><a href="#" onClick="window.open('view/popup-aide-BFA.php','wclose','width=800,height=600,toolbar=no,left=200,top=200');" alt="<?php echo htmlentities('aide sur la hiérarchie des taux de BFA');?>"> <img src="img/point_interrogation.png" alt="point d'interrogation" title="<?php echo htmlentities('aide sur la hiérarchie des taux de BFA');?>"/></a></th> <th>Groupement client</th> <th>Client</th> <th id="interrogation"><div>Code DAS</div><a href="#" onClick="window.open('view/popup-aide-DAS.php','wclose','width=560,height=500,toolbar=no,left=400,top=200');" alt="liste des codes DAS"> <img src="img/point_interrogation.png" alt="point d'interrogation" title="liste des codes DAS"/></a></th> <th>Code groupe produit</th> <th>Taux BFA</th> <th><?php echo htmlentities("Pour l'année"); ?></th> <th></th> </tr> </thead> <tbody>
Code php : 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 <?php while (($data = fgetcsv($handle, 1000, ";")) != FALSE) { $line++; if (substr($data[3], 0, strlen($recherche)) == substr(odbc_result($result, "clccli"), 0, strlen($recherche)) || substr($data[3], 0, strlen($recherche)) == substr(odbc_result($result, "clraic"), 0, strlen($recherche)) || substr($data[3], 0, strlen($recherche)) == strtolower(substr(odbc_result($result, "clraic"), 0, strlen($recherche)))){ echo '<tr><td>'.$data[1].'</td><td>'.$data[2].'</td><td>'.$data[3].'</td><td>'.$data[4].'</td><td>'.$data[5].'</td><td><input type="text" name="bfa" id="champBFA" value="'.$data[6].'"/>%</td> <td>'; if (isThisYear(substr($data[7], 6, 4))) { echo "<input type='radio' name='year' value='n-1' /><input type='radio' name='year' value='n' checked/>"; } else { echo "<input type='radio' name='year' value='n-1' checked /><input type='radio' name='year' value='n' />"; } echo '</td> <td><input type="submit" name="modifier" value="OK" title="Modifier" /></td></tr>'; $nbLine++; } } echo '</tbody></table> <input type="hidden" name="line" value="'.$line.'" /> </div> </form>';?>
Code css : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 #ascenseur { overflow: scroll; height: 200px; } #ascenseur thead{ position: absolute; }
Or mon tbody chevauche mon thead et j'obtiens ça:
Une aide me serait précieuse. Merci!
Partager