1.4 KiB
1.4 KiB
Contract: Dense and Hierarchical Tables
Part of table-management.
Dense and Hierarchical Tables
- An operator-table density override may use
3px 14pxcell padding and middle alignment; subordinate rows may use1pxvertical padding and18pxline 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: 0to 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 substituteoverflow-x: clipfor access to wide columns. - Sorting uses one shared state cycle: ascending, descending, original order. Show the
direction and expose
aria-sorton 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.