HTML table avec scroll: case change de taille
marcelo44
Messages postés
345
Statut
Membre
-
notobe Messages postés 2222 Statut Membre -
notobe Messages postés 2222 Statut Membre -
Bonjour,
n'étant pas aguerri de l'html je me porte à quelques difficultés j'ai enfin réussi à faire un tableau avec scroll verticale en gardant les th fixes mais mon problème est que lorsqu'il n'y a qu'une seule entrée par exemple, elle prend la taille maximum du scroll
mon tableau :
<table border ="1">
<caption>EXERCICE n<?echo $signe.$exo?></caption>
<thead>
<tr>
<th>Heure</th>
<th>Niveau</th>
<th>Vitesse</th>
<th>Point</th>
<th>Faute</th>
<th>Abandon</th>
<th>Nombre de question</th>
<th>Note</th>
</tr>
</thead>
<tbody class="scroll">
<?
while ($Ligne = mysql_fetch_array($Resultat, MYSQL_BOTH))
{
?><tr><td align="center"><?echo $Ligne['Heure'] ;?></td>
<td align="center"><?echo $Ligne['Niveau'] ;?></td>
<td align="center"><?echo $Ligne['Niveau_Temps'] ;?></td>
<td align="center"><?echo $Ligne['Bonne_Reponse'];?></td>
<td align="center"><?echo $Ligne['Mauvaise_Reponse'] ;?></td>
<td align="center"><?echo $Ligne['Abandon'];?></td>
<td align="center"><?echo $Ligne['Nombre_Question'] ;?></td>
<td><?echo $note;?></td></tr>
<?
}
?>
</tbody>
</td></tr>
</table>
Mon css :
.scroll
{
height: 300px;
overflow-y: auto;
overflow-x: hidden
}
n'étant pas aguerri de l'html je me porte à quelques difficultés j'ai enfin réussi à faire un tableau avec scroll verticale en gardant les th fixes mais mon problème est que lorsqu'il n'y a qu'une seule entrée par exemple, elle prend la taille maximum du scroll
mon tableau :
<table border ="1">
<caption>EXERCICE n<?echo $signe.$exo?></caption>
<thead>
<tr>
<th>Heure</th>
<th>Niveau</th>
<th>Vitesse</th>
<th>Point</th>
<th>Faute</th>
<th>Abandon</th>
<th>Nombre de question</th>
<th>Note</th>
</tr>
</thead>
<tbody class="scroll">
<?
while ($Ligne = mysql_fetch_array($Resultat, MYSQL_BOTH))
{
?><tr><td align="center"><?echo $Ligne['Heure'] ;?></td>
<td align="center"><?echo $Ligne['Niveau'] ;?></td>
<td align="center"><?echo $Ligne['Niveau_Temps'] ;?></td>
<td align="center"><?echo $Ligne['Bonne_Reponse'];?></td>
<td align="center"><?echo $Ligne['Mauvaise_Reponse'] ;?></td>
<td align="center"><?echo $Ligne['Abandon'];?></td>
<td align="center"><?echo $Ligne['Nombre_Question'] ;?></td>
<td><?echo $note;?></td></tr>
<?
}
?>
</tbody>
</td></tr>
</table>
Mon css :
.scroll
{
height: 300px;
overflow-y: auto;
overflow-x: hidden
}
A voir également:
- HTML table avec scroll: case change de taille
- Table ascii - Guide
- Table des matières word - Guide
- Editeur html - Télécharger - HTML
- Scroll lock clavier ✓ - Forum Réseaux sociaux
- Touche scroll lock ✓ - Forum Excel
10 réponses
Bon j'ai bien mon tableau qui scroll mais je ne vois pas comment donner la taille de la scrollbar sans affecter la taille du tbody en tout cas avec la méthode que j'utilise....?
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question