<div class="table-responsive">
<table class="table">
<caption>A caption functions like a heading for a table</caption>
<thead>
<tr>
<th>Données géographiques </th>
<th>Léman</th>
<th>Neuchâtel</th>
<th>Morat</th>
<th>Joux</th>
<th>Brenet</th>
<th>Brêt</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Altitude</th>
<td>372 m</td>
<td>429 m</td>
<td>429 m</td>
<td>1004 m</td>
<td>1002 m</td>
<td>673 m</td>
</tr>
<tr>
<th scope="row">Profondeur maximum</th>
<td>310 m</td>
<td>153 m</td>
<td>45 m</td>
<td>33 m</td>
<td>18 m</td>
<td>20 m</td>
</tr>
<tr>
<th scope="row">Rives</th>
<td>200 km</td>
<td>84 km</td>
<td>21 km</td>
<td>21 km</td>
<td>4 km</td>
<td>4 km</td>
</tr>
<tr>
<th scope="row">Superficie</th>
<td>580 km<sup>2</sup></td>
<td>215 km<sup>2</sup></td>
<td>23 km<sup>2</sup></td>
<td>9 km<sup>2</sup></td>
<td>0.7 km<sup>2</sup></td>
<td>0.5 km<sup>2</sup></td>
</tr>
<tr>
<th scope="row">Volume (m<sup>3</sup>)</th>
<td>89 milliards</td>
<td>13.8 milliards</td>
<td>0.55 milliard</td>
<td>132 millions</td>
<td>5 millions</td>
<td>4.5 millions</td>
</tr>
<tr>
<th scope="row">Temps moyen pendant lequel l'eau séjourne dans le lac</th>
<td>12 ans</td>
<td>8.2 ans</td>
<td>1.6 ans</td>
<td>0.85 an</td>
<td>0.3 an</td>
<td>1 an</td>
</tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table">
<caption>{{ caption }}</caption>
<thead>
<tr>
<th>Données géographiques </th>
<th>Léman</th>
<th>Neuchâtel</th>
<th>Morat</th>
<th>Joux</th>
<th>Brenet</th>
<th>Brêt</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Altitude</th>
<td>372 m</td>
<td>429 m</td>
<td>429 m</td>
<td>1004 m</td>
<td>1002 m</td>
<td>673 m</td>
</tr>
<tr>
<th scope="row">Profondeur maximum</th>
<td>310 m</td>
<td>153 m</td>
<td>45 m</td>
<td>33 m</td>
<td>18 m</td>
<td>20 m</td>
</tr>
<tr>
<th scope="row">Rives</th>
<td>200 km</td>
<td>84 km</td>
<td>21 km</td>
<td>21 km</td>
<td>4 km</td>
<td>4 km</td>
</tr>
<tr>
<th scope="row">Superficie</th>
<td>580 km<sup>2</sup></td>
<td>215 km<sup>2</sup></td>
<td>23 km<sup>2</sup></td>
<td>9 km<sup>2</sup></td>
<td>0.7 km<sup>2</sup></td>
<td>0.5 km<sup>2</sup></td>
</tr>
<tr>
<th scope="row">Volume (m<sup>3</sup>)</th>
<td>89 milliards</td>
<td>13.8 milliards</td>
<td>0.55 milliard</td>
<td>132 millions</td>
<td>5 millions</td>
<td>4.5 millions</td>
</tr>
<tr>
<th scope="row">Temps moyen pendant lequel l'eau séjourne dans le lac</th>
<td>12 ans</td>
<td>8.2 ans</td>
<td>1.6 ans</td>
<td>0.85 an</td>
<td>0.3 an</td>
<td>1 an</td>
</tr>
</tbody>
</table>
</div>
{
"caption": "A caption functions like a heading for a table"
}
@charset 'UTF-8';
.table {
caption {
caption-side: top;
}
td,
th {
border-top: 1px solid $vd-neutral-lighter;
padding: 0.75rem;
}
thead th {
border-bottom: 2px solid $vd-neutral-lighter;
vertical-align: bottom;
}
}
Use the default Bootstrap classes on this component. Refer to the official doc for more fancy classes.
Captions and summaries provide information that can help users find, navigate, and understand tables. While they are not required in every case to meet WCAG 2.0, captions and summaries are fairly straightforward ways to provide such information that is often needed.
If both caption and summary are provided for one table, the summary should not duplicate information present in the caption.