Live example
| Order | Items | Total | Status |
|---|---|---|---|
| #1042 | 3 | Rp 412.000 | Shipped |
| #1043 | 1 | Rp 89.000 | Packing |
| #1044 | 2 | Rp 150.000 | Awaiting payment |
Table
A <table> with collapsed 1px rule borders and 4px 8px cell padding, replacing the default 2px spacing and 1px padding.
Consumer provides: a <caption>, header cells as <th scope="col"> or scope="row", and the data.
- Tables are for data with rows and columns, never for layout.
- Always give a caption; it names the table for screen-reader table lists.
- Align numbers to the right with
text-align: endandfont-variant-numeric: tabular-numson those cells. - Wide tables go in a wrapper with
overflow-x: autoso the page itself never scrolls sideways. - State words (“Shipped”) go in the cell as text, never as colour alone.
Composition
React
import { Table } from '@imsus/normal-ui-react';
<Table caption="Orders this week" rowKey={(r) => r.order}
columns={[{ key: 'order', label: 'Order' }, { key: 'total', label: 'Total', numeric: true }]}
rows={orders} />