01
Striped ledger
The default. Semantic markup with a caption, a proper row header per row and tabular figures so the money column lines up.
02
Bordered & compact
.table-bordered with .table-sm and .table-hover — the density finance and admin screens actually want.
03
Mobile reflow
.md:table-stacked is new in v6 — below the breakpoint each row becomes a labelled block instead of forcing a horizontal scroll. Narrow the window to see it.
04
Click-to-sort
Header buttons that sort in place and set aria-sort, so screen readers announce the direction. No library.
05
Search & filter toolbar
A search field and a Combobox status filter above the table, with a live result count and an empty state.
06
Client-side pagination
Three rows a page with real <nav> pagination, a live range readout and disabled end states.
07
Row selection & bulk actions
Checkbox column with a header that goes indeterminate on a partial selection, and a bulk-action bar that appears only when something is chosen.
08
Avatars, badges & progress
What a dashboard table actually holds — avatar and secondary line in one cell, status badges, and an inline progress bar.
09
Sticky header & pinned column
A tall, wide table that scrolls inside its own box — header stuck to the top, reference column pinned to the left.
10
Feature comparison
A pricing matrix with a highlighted column, ticks and crosses that are announced properly, and row headers down the side.
Using these
Each table is a standalone page. Copy the markup out of the one you want
and drop it into your project. The static variants need only Bootstrap 6’s
CSS; sorting, filtering, pagination and row selection are a few dozen lines
of vanilla JavaScript in assets/js/main.js, which you can lift
wholesale or ignore.
What is new in v6
md:table-stacked is the one worth knowing about. Below the
breakpoint it turns each row into a labelled block, so there is no horizontal
scrolling on a phone.
Three things about it are easy to get wrong, and all three fail silently.
The bare .table-stacked class stacks at every width — the
breakpoint prefix is what makes it responsive. The prefixed variants are
@container queries, so the table needs a
.table-responsive ancestor to give them something to measure.
And the labels come from data-cell="…" on each cell; the hidden
<thead> does not supply them, so without it you get an
unlabelled stack.
Markup that pays off
Use <th scope="row"> for the identifying cell in each
row, not <td>. It is what makes a screen reader announce
which record a cell belongs to, and it is what
.md:table-stacked keys off when it reflows. Keep a
<caption> too — it is the accessible name of the table.
Numbers
Money and quantity columns need font-variant-numeric: tabular-nums
and right alignment or the digits will not line up. That is the
.num class in this pack’s stylesheet.
A gotcha worth knowing
Combobox’s search and multiple options are typed
booleans, so a bare attribute fails config validation. Write
data-bs-search="true", not data-bs-search.