Tables
Choose a focused guide for semantic table structure, responsive behavior, visual styles, pagination, or DataTables.net.
Tables
Use tables for genuinely tabular relationships: information users compare by row and column. Start with native table structure, then choose a focused guide for responsive behavior, visual styles, pagination, or the DataTables.net adapter.
Semantic headers, body, and footer
A caption names the dataset, scoped headers expose its row-and-column relationships, and the footer summarizes values without pretending to be another record.
| Plan | Workspaces | Members |
|---|---|---|
| Starter | 18 | 42 |
| Team | 12 | 86 |
| Total | 30 | 128 |
<div class="bs-table-responsive" role="region" tabindex="0" aria-label="Workspace usage by plan">
<table class="bs-table">
<caption>Workspace usage by plan</caption>
<thead><tr><th scope="col">Plan</th><th class="bs-table-cell-numeric" scope="col">Workspaces</th><th class="bs-table-cell-numeric" scope="col">Members</th></tr></thead>
<tbody>
<tr><th scope="row">Starter</th><td class="bs-table-cell-numeric">18</td><td class="bs-table-cell-numeric">42</td></tr>
<tr><th scope="row">Team</th><td class="bs-table-cell-numeric">12</td><td class="bs-table-cell-numeric">86</td></tr>
</tbody>
<tfoot><tr><th scope="row">Total</th><td class="bs-table-cell-numeric">30</td><td class="bs-table-cell-numeric">128</td></tr></tfoot>
</table>
</div>Choose a table topic
Structure
Use <caption>, <thead>, <tbody>, and <tfoot> for their real purposes. Add scope="col" or scope="row" to unambiguous headers.
Choose a guide
Start with fundamentals, add only the visual modifiers your dataset needs, then choose application-owned pagination or the DataTables.net integration.
Behavior ownership
Boobstrap provides presentation. Your application or data library owns row ordering, filters, loading, current-page state, and result announcements.
Core table API
Every guide builds on these three primitives. The child references document the optional classes alongside the examples they affect.
| Class | Purpose | Use it on |
|---|---|---|
.bs-table | Provides readable cells, semantic header groups, row dividers, captions, and footer treatment. | The native <table>. |
.bs-table-responsive | Contains horizontal overflow without widening the page. | A named, keyboard-focusable wrapper around the table. |
.bs-table-cell-numeric | Right-aligns tabular numbers and prevents unwanted wrapping. | Matching header and data cells. |