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

Keep the caption as the table’s first child in HTML even when it appears below the data.

HTML
<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

ClassCSS declarations
caption-topcaption-side: top;
caption-bottomcaption-side: bottom;
View full generated CSS
Compiled CSS
.caption-bottom {
  caption-side: bottom;
}
.caption-top {
  caption-side: top;
}