Skip to content

Add contained prop to table - #2759

Draft
ganyicz wants to merge 1 commit into
mainfrom
filip/contained-table
Draft

Add contained prop to table#2759
ganyicz wants to merge 1 commit into
mainfrom
filip/contained-table

Conversation

@ganyicz

@ganyicz ganyicz commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

The scenario

When a table is used inside a bordered container like card, its columns are pushed towards the outer edges:

<flux:card class="p-0">
    <flux:table>
        ...
    </flux:table>
</flux:card>
SCR-20260820-njbs

The problem

Table columns and cells automatically remove the padding from first and last column:

...first:ps-0 last:pe-0...

To override this, the the original padding needs to be added back individually with an important modifier:

<flux:table.columns>
    <flux:table.column class="ps-3!">...</flux:table.column>
    ...
    <flux:table.column class="pe-3!">...</flux:table.column>
</flux:table.column>

<flux:table.rows>
    <flux:table.cell class="ps-3!">...</flux:table.cell>
    ...
    <flux:table.cell class="pe-3!">...</flux:table.cell>
</flux:table.rows>

The solution

  1. Add contained prop:
SCR-20260820-nous
  1. Add [:where(&)] to all padding classes to allow overriding them without important modifier

Docs: https://github.com/livewire/flux-docs/pull/200

@ganyicz
ganyicz marked this pull request as draft August 20, 2026 17:21
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.

1 participant