Files
bible/rules/patterns/table-management/density/contract.md
T

24 lines
1.4 KiB
Markdown

# Contract: Dense and Hierarchical Tables
Part of [table-management](../contract.md).
## Dense and Hierarchical Tables
- An operator-table density override may use `3px 14px` cell padding and middle alignment;
subordinate rows may use `1px` vertical padding and `18px` line height. Scope the override
to dense tables rather than changing key-value detail tables.
- Keep parents visually stronger than children. Indent children and align their columns;
omit redundant repeated parent fields. Expand only when there is meaningful detail.
- Expansion and editing are different actions. Use a keyboard-operable expand button with
`aria-expanded`; clicking a row action must not also toggle expansion.
- Sticky headers may use `border-collapse: separate; border-spacing: 0` to avoid collapsed
border rendering artifacts. Choose the scrolling owner explicitly. For a bounded table,
stick headers inside its scroll container and preserve horizontal scrolling.
Do not substitute `overflow-x: clip` for access to wide columns.
- Sorting uses one shared state cycle: ascending, descending, original order. Show the
direction and expose `aria-sort` on the header; use a button for keyboard activation.
Keep child groups attached to their parents. With server pagination, sort the query on
the server rather than just the loaded page.
See the [sortable-header example](README.md).