# Table

A data table with hairlines between the rows, numbers right aligned, and its own sideways scroll.

Group: Data. Code: `components/software/table.tsx`. From the old system: Table in @id-identity-as/ui/commerce. Live: https://design.id-hub.dk/software/table

```tsx
import { Table } from '@/components/software/table';

<Table
  caption="Ordrelinjer"
  rowHeader="sku"
  columns={[
    { key: 'sku', header: 'Varenr.' },
    { key: 'name', header: 'Produkt' },
    { key: 'quantity', header: 'Antal', align: 'end' },
  ]}
  rows={lines}
/>
```

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| caption (required) | `string` |  | What the table holds. Shown above it and read aloud as its name. |
| captionHidden | `boolean` | `false` | Hides the caption from the eye when a heading right above already says it. |
| columns (required) | `TableColumn[]` |  | { key, header, align? }. align: 'end' is for numbers. |
| rows (required) | `TableRow[]` |  | One object per row, with a cell for each column key. Numbers come in formatted. |
| rowHeader | `string` |  | The key of the column that names each row. Its cells become row headers. |

Do:
- Right align numbers with align: 'end'. They are set in tabular figures.
- Name the row with rowHeader, such as the order number.
- Paginate a long list with Pagination.

Do not:
- Do not draw a full grid or stripe the rows. Hairlines only.
- Do not use a table for layout.
- Do not leave an empty table. Show an EmptyState.

Accessibility:
- A real table with a caption, column headers and, with rowHeader, row headers.
- The frame scrolls sideways and can take focus, so a keyboard reaches the columns off screen.

Tokens it uses:
- color.border.default
- color.text.default
- type.body.sm
- type.heading.sm
- type.heading.md
- space.inline.2
- space.inline.3

---

Not drawn in Figma. Kasper decided on 20 November 2026 that internal software gets this set now, built only from the tokens. The look is ours until Peter draws it, and every open choice is a question in docs/SPOERGSMAAL-TIL-PETER.md. The public site, campaigns and brand surfaces use only the components drawn in Figma.

The rules for this set and all 33 components: https://design.id-hub.dk/software.md. Token values: https://design.id-hub.dk/tokens.md.

Index of everything, as text: https://design.id-hub.dk/llms.txt. Never invent a colour, a size, a component or a product fact: if it is not here, it does not exist yet.
