Skip to content

[6.x] Pad flush tables' outer cells instead of their container - #19936

Merged
brandonkelly merged 7 commits into
6.xfrom
really-flush-tables
Oct 11, 2026
Merged

brandonkelly merged 7 commits into
6.xfrom
really-flush-tables

Conversation

@brandonkelly

@brandonkelly brandonkelly commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Description

Flush admin tables and element index tables now span their container's inline padding, rather than sitting inside it. cp-table--flush pads each row's first and last cells by --cp-container-padding to match, so the table's rules and row hovers reach the container's edges while cell content still lines up with the header and footer.

This replaces the approach from #19906, which removed the padding from the outer cells.

Tables now take a single appearance option, matching how appearance sets surface treatment on <craft-pane> and other components:

Value Meaning
plain Sits inside the container's padding.
flush Spans the container's inline padding, padding each row's outer cells to match.
raised Sits in a raised pane.
  • AdminTable's padded prop is now appearance. A flush table pads only its header and footer, and a raised one is set in a pane by AdminTable itself.
  • DataTable's and ElementTable's flush props are now appearance (plain or flush).
  • ElementIndex takes a tableAppearance (flush by default), and drops its body's inline padding while a flush table view is showing. Cards and thumbnails keep it. Nested element indexes, whose --cp-container-padding is 0, use plain.
  • CraftCms\Cms\Ui\Nodes\Table::bordered() is now appearance(), backed by a new CraftCms\Cms\Cp\Enums\TableAppearance enum. Unset, a table that's all its page has is flush; otherwise it's plain.
  • The values are exported as TableAppearance from @craftcms/cp.

🤖 Generated with Claude Code

brandonkelly and others added 2 commits October 10, 2026 06:25
Padded admin tables and element index tables now span their container's
inline padding, and `cp-table--flush` pads each row's first and last
cells by `--cp-container-padding` instead of removing that padding.

Nested element indexes opt out via ElementIndex's new `flushTable` prop,
since their container padding is 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

@brianjhanson brianjhanson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this but I wonder if it would be simpler to have a display or mode property instead. The goal being to make it easier to keep track of the various display states.

display="full" → Element index pages
display="padded" → padding everywhere
display="flush" → nothing padded

Very possible I'm not thinking about all the use cases though.

brandonkelly and others added 4 commits October 11, 2026 07:37
The test from #19935 expected the body to be inset by the container
padding, which this PR replaces with padding on each row's outer cells.
It also applied the `admin-table--padded` class rather than the `padded`
prop, which never made the table flush.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tables now take one `appearance`: `plain`, `flush` or `raised`, matching
how `appearance` sets surface treatment on `<craft-pane>` and other
components.

- `AdminTable`'s `padded` prop is now `appearance`, and a `raised` table
  is set in a pane by `AdminTable` itself, rather than by `AdminTableNode`.
- `DataTable`'s and `ElementTable`'s `flush` props are now `appearance`,
  and `ElementIndex`'s `flushTable` is now `tableAppearance`.
- `CraftCms\Cms\Ui\Nodes\Table::bordered()` is now `appearance()`, backed
  by the new `CraftCms\Cms\Cp\Enums\TableAppearance`. Unset, a table that's
  all its page has is `flush`; otherwise it's `plain`.
- The values are exported as `TableAppearance` from `@craftcms/cp`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandonkelly

Copy link
Copy Markdown
Member Author

@brianjhanson 👍🏻 with with appearance. d2caab0

@brandonkelly
brandonkelly merged commit a505ae6 into 6.x Oct 11, 2026
20 checks passed
@brandonkelly
brandonkelly deleted the really-flush-tables branch October 11, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants