F
Filament16mo ago
Kleis

Make table fixed?

I may have overlooked this in the docs, is there a way to specify a table should ude table-fixed class instead of table-auto? Or is the correct solution so override the tag using the fi class and custom CSS? (I want all columns to have same width)
5 Replies
toeknee
toeknee16mo ago
You can use: ->extraAttributes(['class' => 'min-width-2xl max-width-2xl']) per column etc use tailwind classes ideally, and if you are not using them ensure to whitelist them in your tailwind config to ensure they are always compiled.
Kleis
KleisOP16mo ago
Yes but that will lock them to a specific size, whereas the table-fixed locks them to the size of the first row, so that the table is still responsive, but content can't push the size.
toeknee
toeknee16mo ago
So apply that class to the table with extraAttributes?
Kleis
KleisOP16mo ago
That was my initial idea, but extraAttributes is not available on the table, only on the columns. So my current solution is to override it in a style tag on the 2 pages where I need -fixed, but was hoping for something a bit more elegant 🙂
<style>
.fi-ta-table {
table-layout: fixed !important;
}
</style>
<style>
.fi-ta-table {
table-layout: fixed !important;
}
</style>
awcodes
awcodes16mo ago
There’s no way to do anything elegant with html tables. 😅
Want results from more Discord servers?
Add your server