Overview Button Copy button Field Input Number field Textarea Select Combobox Multiselect Date picker Date range picker Date-time picker Checkbox Radio group Position picker Switch Slider Dropzone Device controls Avatar Badge Card Collapsible Kbd Map Matrix Proportion bar Separator Stat Table Timeline Chat Playback Pagination Charts Chart theming Profile chart Time series chart Bar chart Isopleth chart TS diagram Box plot Rose chart Calendar chart Banner Toast Loader Progress Skeleton Empty state Error state Dropdown menu Tooltip Info tooltip Dialog Sheet Resizable Confirm dialog Breadcrumbs Command palette Mobile menu Navigation list Outline Scroll rail Sidebar Tabs
Table
Rows of records with the same fields, for reading across and comparing down. A rounded frame with lines between rows by default; a grid for data; plain inside a card.
Playground
Sort by a column, tick rows, scroll sideways past the pinned columns and down under the header.
| Time | Status | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| HF-1 | 08:12 | 48,2 | 7,84 | 33,91 | 8,62 | 0,41 | 1,12 | Published | |
| HF-2 | 08:47 | 62,5 | 7,71 | 34,02 | 8,48 | 0,38 | 0,98 | Published | |
| HF-3 | 09:20 | 31,0 | 8,05 | 33,64 | 8,81 | 0,55 | 1,46 | In review | |
| Kvamsøy | 09:58 | 120,4 | 7,32 | 34,38 | 7,95 | 0,29 | 0,61 | Published | |
| Norheimsund | 11:05 | 54,3 | 7,90 | 33,88 | 8,55 | 0,47 | 1,21 | In review | |
| Tørvikbygd | 12:16 | 76,1 | 7,58 | 34,12 | 8,27 | 0,36 | 0,86 | Published | |
| Øystese | 11:42 | 41,9 | 8,11 | 33,59 | 8,90 | 0,62 | 1,58 | Published | |
| Ålvik | 10:31 | 88,7 | 7,48 | 34,21 | 8,12 | 0,33 | 0,77 | Flagged |
Variant
Size
2 of 8 selected
<Table variant="grid" stickyHeader class="max-h-64">
<TableHeader>
<TableRow>
<TableHead shrink pin="start"><Checkbox … /></TableHead>
<TableHead pin="start" sort="asc" onSort={…}>Waypoint</TableHead>
<TableHead numeric>Depth (m)</TableHead>
…
</TableRow>
</TableHeader>
<TableBody>
{#each casts as cast (cast.id)}
<TableRow selected={…}>
…
<TableCell numeric>{cast.depth}</TableCell>
</TableRow>
{/each}
</TableBody>
</Table> Bordered
The default: a list where each row opens something. The row lights up on hover because it has an onclick.
| Date | Project | Vessel | Waypoints | Status |
|---|---|---|---|---|
| 3. mars | Hardangerfjorden 2026 | USV Bris | 12 | Completed |
| 17. mars | Hardangerfjorden 2026 | USV Bris | 12 | Completed |
| 2. april | Starefoss ledning | USV Kuling | 6 | Scheduled |
| 9. april | Starefoss ledning | USV Kuling | 6 | Scheduled |
Click a row.
<Table>
<TableHeader>
<TableRow>
<TableHead>Date</TableHead>
<TableHead>Project</TableHead>
<TableHead numeric>Waypoints</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{#each missions as mission (mission.id)}
<TableRow onclick={() => open(mission)}>…</TableRow>
{/each}
</TableBody>
</Table> Grid with totals
The data table: a line per column, numbers right-aligned in tabular figures. Totals go in a TableFooter.
| Waypoint | Depth (m) | Temp. (°C) | Salinity (PSU) |
|---|---|---|---|
| HF-1 | 48,2 | 7,84 | 33,91 |
| HF-2 | 62,5 | 7,71 | 34,02 |
| HF-3 | 31,0 | 8,05 | 33,64 |
| Kvamsøy | 120,4 | 7,32 | 34,38 |
| Average | 65,5 | 7,73 | 33,99 |
Plain
Inside a card or a sheet: no frame of its own, the container is the frame.
Fuel
| Date | Litres |
|---|---|
| 3. mars | 42 |
| 17. mars | 38 |
| 2. april | 45 |
Sticky header on the page
StickyTable: scroll the page and the header stays under the top bar; scroll sideways and both move together. The waypoint stays pinned.
| Waypoint | Time | Depth (m) | Temp. (°C) | Salinity (PSU) | Oxygen (mg/l) | Turbidity (NTU) | Chl a (µg/l) | Status |
|---|---|---|---|---|---|---|---|---|
| HF-1 | 08:00 | 48,2 | 7,84 | 33,91 | 8,62 | 0,41 | 1,12 | Published |
| HF-2 | 08:09 | 63,0 | 7,71 | 34,02 | 8,48 | 0,38 | 0,98 | Published |
| HF-3 | 08:18 | 32,0 | 8,05 | 33,64 | 8,81 | 0,55 | 1,46 | In review |
| Kvamsøy | 08:27 | 121,9 | 7,32 | 34,38 | 7,95 | 0,29 | 0,61 | Published |
| Ålvik | 08:36 | 90,7 | 7,48 | 34,21 | 8,12 | 0,33 | 0,77 | Flagged |
| Norheimsund | 08:45 | 54,3 | 7,90 | 33,88 | 8,55 | 0,47 | 1,21 | In review |
| Øystese | 08:54 | 42,4 | 8,11 | 33,59 | 8,90 | 0,62 | 1,58 | Published |
| Tørvikbygd | 09:03 | 77,1 | 7,58 | 34,12 | 8,27 | 0,36 | 0,86 | Published |
| HF-1 | 09:12 | 49,7 | 7,84 | 33,91 | 8,62 | 0,41 | 1,12 | Published |
| HF-2 | 09:21 | 64,5 | 7,71 | 34,02 | 8,48 | 0,38 | 0,98 | Published |
| HF-3 | 09:30 | 31,0 | 8,05 | 33,64 | 8,81 | 0,55 | 1,46 | In review |
| Kvamsøy | 09:39 | 120,9 | 7,32 | 34,38 | 7,95 | 0,29 | 0,61 | Published |
| Ålvik | 09:48 | 89,7 | 7,48 | 34,21 | 8,12 | 0,33 | 0,77 | Flagged |
| Norheimsund | 09:57 | 55,8 | 7,90 | 33,88 | 8,55 | 0,47 | 1,21 | In review |
| Øystese | 10:06 | 43,9 | 8,11 | 33,59 | 8,90 | 0,62 | 1,58 | Published |
| Tørvikbygd | 10:15 | 76,1 | 7,58 | 34,12 | 8,27 | 0,36 | 0,86 | Published |
| HF-1 | 10:24 | 48,7 | 7,84 | 33,91 | 8,62 | 0,41 | 1,12 | Published |
| HF-2 | 10:33 | 63,5 | 7,71 | 34,02 | 8,48 | 0,38 | 0,98 | Published |
| HF-3 | 10:42 | 32,5 | 8,05 | 33,64 | 8,81 | 0,55 | 1,46 | In review |
| Kvamsøy | 10:51 | 122,4 | 7,32 | 34,38 | 7,95 | 0,29 | 0,61 | Published |
| Ålvik | 11:00 | 88,7 | 7,48 | 34,21 | 8,12 | 0,33 | 0,77 | Flagged |
| Norheimsund | 11:09 | 54,8 | 7,90 | 33,88 | 8,55 | 0,47 | 1,21 | In review |
| Øystese | 11:18 | 42,9 | 8,11 | 33,59 | 8,90 | 0,62 | 1,58 | Published |
| Tørvikbygd | 11:27 | 77,6 | 7,58 | 34,12 | 8,27 | 0,36 | 0,86 | Published |
| HF-1 | 11:36 | 50,2 | 7,84 | 33,91 | 8,62 | 0,41 | 1,12 | Published |
| HF-2 | 11:45 | 62,5 | 7,71 | 34,02 | 8,48 | 0,38 | 0,98 | Published |
| HF-3 | 11:54 | 31,5 | 8,05 | 33,64 | 8,81 | 0,55 | 1,46 | In review |
| Kvamsøy | 12:03 | 121,4 | 7,32 | 34,38 | 7,95 | 0,29 | 0,61 | Published |
| Ålvik | 12:12 | 90,2 | 7,48 | 34,21 | 8,12 | 0,33 | 0,77 | Flagged |
| Norheimsund | 12:21 | 56,3 | 7,90 | 33,88 | 8,55 | 0,47 | 1,21 | In review |
| Øystese | 12:30 | 41,9 | 8,11 | 33,59 | 8,90 | 0,62 | 1,58 | Published |
| Tørvikbygd | 12:39 | 76,6 | 7,58 | 34,12 | 8,27 | 0,36 | 0,86 | Published |
| HF-1 | 12:48 | 49,2 | 7,84 | 33,91 | 8,62 | 0,41 | 1,12 | Published |
| HF-2 | 12:57 | 64,0 | 7,71 | 34,02 | 8,48 | 0,38 | 0,98 | Published |
| HF-3 | 13:06 | 33,0 | 8,05 | 33,64 | 8,81 | 0,55 | 1,46 | In review |
| Kvamsøy | 13:15 | 120,4 | 7,32 | 34,38 | 7,95 | 0,29 | 0,61 | Published |
| Ålvik | 13:24 | 89,2 | 7,48 | 34,21 | 8,12 | 0,33 | 0,77 | Flagged |
| Norheimsund | 13:33 | 55,3 | 7,90 | 33,88 | 8,55 | 0,47 | 1,21 | In review |
| Øystese | 13:42 | 43,4 | 8,11 | 33,59 | 8,90 | 0,62 | 1,58 | Published |
| Tørvikbygd | 13:51 | 78,1 | 7,58 | 34,12 | 8,27 | 0,36 | 0,86 | Published |
<StickyTable variant="grid" columns={[140, 80, 130, …]}>
{#snippet head()}
<TableRow>
<TableHead pin="start">Waypoint</TableHead>
…
</TableRow>
{/snippet}
{#snippet body()}
{#each casts as cast (cast.id)}
<TableRow><TableCell pin="start">{cast.waypoint}</TableCell>…</TableRow>
{/each}
{/snippet}
</StickyTable> Which one
Bordered The default. A list of things that each open somewhere: missions, projects, members. A few columns that fit.
Grid The data table: measurements, logs, exports. Many columns of numbers read across and down, so every column gets a line. Dense by default.
Plain Inside a card, a sheet or a dialog, where the container is already the frame.
StickyTable A wide table on a long page, so the header follows you down while the columns scroll sideways. Column widths are fixed up front.
Not a table One record, or items with no shared fields to compare: a list of cards or rows. Editing many cells like a spreadsheet: the data grid (AG Grid).
Sticky headers
In its own box <Table stickyHeader class="max-h-96">. A panel or a dialog with a capped height. Scrolls both ways; pinned columns work.
On the page <Table stickyHeader="page">. A long table that fits the width. It can't scroll sideways, so only for columns that fit.
Wide, on the page StickyTable. Both at once, at the cost of fixed column widths.
Under a bar Pass stickyTop="top-14" (or the bar's height) when something is already pinned above.
Rules
- Headers are short nouns with the unit in brackets: "Depth (m)", not "Depth in metres". Sentence case, never uppercase, in every variant.
- Numbers are right-aligned in tabular figures (
numeric), with the same number of decimals down a column, so they compare at a glance. Text and dates are left-aligned. - The first column says which record the row is: a name, a waypoint, a date. Give it
font-medium. Secondary values, like a time or an owner, can be muted. - A missing value says so in the muted colour: "Not measured", "Unknown". Never a blank cell, "N/A" or a literal "null".
- Put a row's own actions at the end, in a
shrinkcolumn: one icon button, or a more menu for several. Actions on many rows at once go in a bar above the table, shown once rows are ticked. - A row that opens something gets an
onclickand lights up on hover. Keep a real link in its first cell too, so it works with the keyboard and opens in a new tab. - Pin the column that names the row when the table scrolls sideways, and the checkbox column with it. Pin the end column for status or actions. One or two per side, never most of the table.
- Sort when there are more rows than fit on a screen. Show the sorted column's arrow; start with the order people expect (newest first for dates).
- While loading, draw the table it will be with
TablePlaceholder state="loading", not a spinner in the middle, then give the arriving rows anenterIndex. Empty, lay an EmptyState overTablePlaceholder state="empty", saying why with a way forward. See Skeleton and Empty state. - Tick rows with
RowSelection: Shift-click ticks the run from the last row clicked, in the order shown, and Escape clears. The header checkbox ticks the rows shown, not the ones a filter hides. - Name the table for screen readers with
aria-labelwhen no heading right above it says what it is. - Over a few hundred rows: give StickyTable
items, arowsnippet andvirtual, so only the rows in view are rendered (see the CTD data example). Rows must be one line tall, and find in page only sees what's on screen. Editing cells in place, grouping or pivoting: that's the data grid, not this.