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
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.
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.
So apply that class to the table with extraAttributes?
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 🙂
There’s no way to do anything elegant with html tables. 😅