# TableCell

> A table data cell (<td>) for the Table family. align controls text alignment; numeric right-aligns with tabular figures so columns line up on the decimal.

- Status: stable
- Group: data-display
- Page: https://www.digitaltableteur.com/design-system/components/table-cell
- Contract: https://www.digitaltableteur.com/contracts/v1/TableCell.contract.json

## When to use

TableCell is the body cell of the Table family: plain tabular data with an optional numeric mode that aligns figures on the decimal. Header semantics belong to TableHeaderCell; TableCell never announces scope.

## When not to use

- Do not render it outside a table row.
- Do not use it for a header; use TableHeaderCell so column/row context is announced.

## Look-alikes

- TableHeaderCell: Do not use it for a header; use TableHeaderCell so column/row context is announced.

## Props

| Prop | Type | Default | Description | Required |
| --- | --- | --- | --- | --- |
| `align` | `"center" \| "end" \| "start"` | `start` | Cell content alignment. Defaults to "start", or "end" when numeric is set. | No |
| `numeric` | `boolean` | `false` | Right-align and tabular-figure numeric values. | No |
| `label` | `string` | none | Column name shown before the value when the parent Table stacks rows (stackOnNarrow). Hidden from assistive technology, which reads the column header instead. | No |

## Variants

- Allowed `align` values: `start`, `center`, `end` (default `start`).
- Allowed `numeric` values: `true`, `false` (default `false`).

## Invalid combinations

The contract records no invalid combinations.

## Keyboard

The contract records no keyboard interaction.

## Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

| Level | Rule | How it is checked |
| --- | --- | --- |
| MUST | ARIA: Native <td> with an explicit role="cell", which keeps cell semantics when a stacked (stackOnNarrow) table changes display; keep the role. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | ARIA: Pairs with TableHeaderCell scope=col/row so cells inherit column and row context. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | Required stories produce no axe violations at the configured severity. | Automated by `npm run test:stories:matrix:ci`. WCAG 2.5.8. |
| MUST | The accessibility tree (role, name, state) matches the committed snapshot for every required story. | Automated by `npm run test:stories:matrix:ci`. WCAG 1.3.1, 4.1.2. |
| MUST | The component remains legible and operable under a real browser forced-colors: active pass. | Automated by `npm run test:stories:hc`. |
| MUST | A human completed an end-to-end accessibility review of this component. | Manual review, last on 2026-11-04. |

## Install and import

- Install: `npm install @digitaltableteur/react` (version 0.9.1, restricted access on npm).
- Import: `import { TableCell } from "@digitaltableteur/react";`
- Entry point: `@digitaltableteur/react/content` exports it too.
- Styles: import `@digitaltableteur/react/style.css` once at the app boundary.

## Links

- Machine-readable contract (Design System Contract 1.0): https://www.digitaltableteur.com/contracts/v1/TableCell.contract.json
- Markdown version of this page: https://www.digitaltableteur.com/design-system/components/table-cell.md
- Component index as JSON: https://www.digitaltableteur.com/design-system/components.json
- All components: https://www.digitaltableteur.com/design-system/components
- Source: The implementation lives in a private repository. This page, its Markdown twin and the contract are generated from it at build time and are the public source of truth.
