Open VSerain opened 8 months ago
table {
border-collapse: collapse;
width: 100%;
}
.test {
/* fr-table already relative */
/* position: relative; */
height: 200px;
overflow: auto;
}
.test th {
position: sticky;
top: 0;
background-color: black;
color: white;
}
<div class="fr-table test" id="table-7497">
<table>
<thead>
<tr>
<th scope="col">th0</th>
<th scope="col">th1</th>
<th scope="col">th2</th>
<th scope="col">th3</th>
<th scope="col">th4</th>
<th scope="col">th5</th>
</tr>
</thead>
<tbody>
<tr>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
</tr>
<tr>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
</tr>
<tr>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
</tr>
<tr>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
</tr>
<tr>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
</tr>
<tr>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
<td>Lorem [...] elit ut.</td>
</tr>
</tbody>
</table>
</div>
@VSerain @alice-telescoop j'ai mis ça là si vous voulez jouer mais pour le moment j'ai pas trouvé comment reproduire le header sticky trouvé sur les internet comme https://codyhouse.co/nuggets/sticky-table-header
message sur slack pour voir comment le DSFR gèrerai ce sticky header ou plutôt une variante accessible et DSFR friendly
@alice-telescoop @VSerain je passe ce ticket en need information
Des nouvelles du DSFR d'ici une semaine
Je le remets dans le sprint pour qu'on l'oublie pas
.
Je le met dans le prochain sprint pour vérifier
Stuck by #2560
stuck by le DSFR ^1