Browse documentation
Reference / Tables
Caption side
Place a table’s caption above or below its rows while preserving the semantic connection to the data.
Working example
| Edition | Copies |
|---|---|
| Field Notes | 32 |
Keep the caption as the table’s first child in HTML even when it appears below the data.
<table class="w-full text-left">
<caption class="caption-bottom pt-2 text-sm">Stock counted on Monday.</caption>
<thead><tr><th class="border-b">Edition</th><th class="border-b">Copies</th></tr></thead>
<tbody><tr><td>Field Notes</td><td>32</td></tr></tbody>
</table>Class reference
| Class | CSS declarations |
|---|---|
caption-top | caption-side: top; |
caption-bottom | caption-side: bottom; |
View full generated CSS
.caption-bottom {
caption-side: bottom;
}
.caption-top {
caption-side: top;
}