You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Table: rows and columns with per-column alignment, row rules and a rounded container #20
Requested by the user. A table in the style of shadcn's Table / Data Table:
a rounded, bordered container;
a header row;
rows separated by hairlines;
columns whose widths line up across rows;
per-column alignment (the first column left, the last right, numbers right);
optional hover and selected row states.
Design questions
Column alignment across rows. A grid with column tracks lines the columns up. But row rules and row hover need a node per row, and taffy has no subgrid. Options:
every row is its own grid with the same track list (simple; widths only agree for fixed or fr tracks, not content-sized ones);
one grid with row-spanning background nodes behind each row for hover and rules (content-sized columns work);
a library helper that measures column widths once and shares them.
Decide with a spike.
Library helper or pattern. It could be a documented pattern built from existing classes, or a small prim::table builder (columns(&[Column { track, align }]), header, row(key, …)). Prefer the pattern unless the column-sharing problem needs library code.
Scrolling and long tables. These depend on M5 (scroll) and M8 (virtual lists); a sticky header is out of scope (no position: sticky).
Where
After M4c, as its own item, probably alongside M5 so a long table can scroll. Add an example, and use it in chat_shell where tabular data appears.
Related: #18 item 26 (the grouped two-column form in chat_shell's details panel, which needs no table).
From the port: striped key–value grids want the stripe across the whole row, gaps included; per-cell backgrounds leave a hole at gap_x (CSS-faithful). A row-level paint (or display: contents row wrappers, which taffy lacks) belongs with this table work.
Correction to my earlier comment: striping a full grid row needs neither a row-paint hook nor display: contents. The CSS idiom works as is: one col_span_full().row_start(r) item per striped row, declared before the explicitly placed cells. It's documented with a tested example in the crate docs (PR "docs: striped grid rows"). Table work here can build on it.
T1: a builder, b.table(key).columns([..]).header(..).rows(&items, key_fn, |row, item| ..); the whole table is one grid with row bands; a wrong cell count is a debug panic.
T2: per-column Start/Center/End alignment.
T3: hover always; opt-in, app-owned single selection with arrow keys.
T4: no virtualization or sticky header in v0.1.
T5: cells hold any content.
T6: a footer row, no caption.
T7: Table/Row/ColumnHeader/Cell roles with indices.
Look decided (user, 2026-11-15): (a), shadcn's Table as it ships (row rules, plain header, hover muted/50, selected muted, a muted/50 footer). The fills and rules are TableStyle fields, so the muted-header and zebra variants stay one preset change away.
T3 revised (user, 2026-11-16): rows aren't focusable, as in shadcn. Selection is app state shown as the row fill, set by a row click or a checkbox cell; there's no row keyboard navigation.
Activity
samitbasu commentedon Nov 11, 2026
From the port: striped key–value grids want the stripe across the whole row, gaps included; per-cell backgrounds leave a hole at
gap_x(CSS-faithful). A row-level paint (ordisplay: contentsrow wrappers, which taffy lacks) belongs with this table work.samitbasu commentedon Nov 12, 2026
Correction to my earlier comment: striping a full grid row needs neither a row-paint hook nor
display: contents. The CSS idiom works as is: onecol_span_full().row_start(r)item per striped row, declared before the explicitly placed cells. It's documented with a tested example in the crate docs (PR "docs: striped grid rows"). Table work here can build on it.samitbasu commentedon Nov 16, 2026
Design decided (user, 2026-11-15):
b.table(key).columns([..]).header(..).rows(&items, key_fn, |row, item| ..); the whole table is one grid with row bands; a wrong cell count is a debug panic.samitbasu commentedon Nov 16, 2026
Look decided (user, 2026-11-15): (a), shadcn's Table as it ships (row rules, plain header, hover muted/50, selected muted, a muted/50 footer). The fills and rules are
TableStylefields, so the muted-header and zebra variants stay one preset change away.samitbasu commentedon Nov 16, 2026
T3 revised (user, 2026-11-16): rows aren't focusable, as in shadcn. Selection is app state shown as the row fill, set by a row click or a checkbox cell; there's no row keyboard navigation.
Table rows are not focusable: a click selects, cell controls take Tab (…
Merge pull request #271 from samitbasu/table-20