How to increase table max width layout?

I have a large screen. I want to be able to see all the table rows without scrolling horizontally. Using the admin panel, how to change the main css: <main class="fi-main mx-auto h-full w-full px-4 md:px-6 lg:px-8 max-w-7xl sticky-theme-default"> i need to change the max-w-7xl and increase it. (ive tested it in the browser and yeah, that makes the trick, so yeah that is what i need) any "clean" way, or i just override the css somehow? i tried to find how to do it in the docs
33 Replies
bernhard
bernhard7mo ago
Do you mean setting protected ?string $maxContentWidth = "full"; in the ListRecords class?
ericmp #2
ericmp #27mo ago
no clue, let me try to test it now i just found this: inside panel fn in adminpanelprovider: ->maxContentWidth('20px') and i did put 20 just to test now is full width nice
bernhard
bernhard7mo ago
You can set it globally in the PanelProvider or just for one specific Page in the Page class
ericmp #2
ericmp #27mo ago
cool, and should be a tailwind class right?
bernhard
bernhard7mo ago
full is ok
ericmp #2
ericmp #27mo ago
and if i want max-w-8xl, how to do it?
bernhard
bernhard7mo ago
use the helper class Filament\Support\Enums\MaxWidth
ericmp #2
ericmp #27mo ago
ah i see - (\Filament\Support\Enums\MaxWidth|string|null $maxContentWidth) thanks 🙏 appreciate ur time
bernhard
bernhard7mo ago
this is just a shorthand of the tailwind classes. but its more bullet-prove I think
bernhard
bernhard7mo ago
Maybe. I have a look. Mark this question as completed, please
ericmp #2
ericmp #27mo ago
i did
btx
btx7mo ago
Glad that I found this thread. This Info MUST be somewhere in the table docs, even if you don't directly configure the table width. But when searching for it, you will assume, that the table width is limited, and not the page container width. I had to search for 30 mins now, just to find how to increase the width of a single table. Would be also good to know, how I can set it exactly to 1400px
ericmp #2
ericmp #27mo ago
agree not sure how to make it 1400px exactly, u solved it?
bernhard
bernhard6mo ago
i think you could just use max-w-1400px as maxContentWidth and add the max-w-1400px to your tailwind config's safelist. Not tested, just a guess
btx
btx6mo ago
@bernhard The class name gets correctly added to the div container. Howver it seems tailwind does not compile it. I tried npm run dev and npx tailwindcss -w. Also created a custom class using { theme: { maxWidth: { cool: '1900px' } } } to have max-w-cool. Im out of ideas
bernhard
bernhard6mo ago
add it to your theme css file Sry, was i typo. its of course max-w-[1400px] (with []) So what you have to do Set the max width in the PanelProvider Class:
->maxContentWidth("max-w-[1400px]")
->maxContentWidth("max-w-[1400px]")
and then you just have to add it to the safelist of tailwind as well
safelist: ['max-w-[1400px]'],
safelist: ['max-w-[1400px]'],
(tailwind.config.js)
btx
btx6mo ago
I added a test class in /resources/css/app.css but it seems my css is not compiling. Im running vite, this should usually handle it, doesnt?
bernhard
bernhard6mo ago
well, if you follow the above 2 steps, you dont need an extra css
bernhard
bernhard6mo ago
but if you like to add extra css, follow the docs for theming: https://filamentphp.com/docs/3.x/panels/themes
btx
btx6mo ago
I tried it using the tailwind syntax max-w-[1400px], but seems rather a bundling issue from my side. Also removed the @tailwind base; ... entries, and the app is still working 🤔
bernhard
bernhard6mo ago
where did you remove this?
btx
btx6mo ago
in /resources/css/app.css
bernhard
bernhard6mo ago
have u added this as a theme?
btx
btx6mo ago
No, I'm pretty much using the Filament oob config
bernhard
bernhard6mo ago
then it isn't used at all so you can add or remove whatever you want, its just a useless file 😉
btx
btx6mo ago
ok 😄
bernhard
bernhard6mo ago
as I said, if you want to customize the styling more, follow the guide https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme
btx
btx6mo ago
Still struggling with tailwind. The page is still full width
No description
No description
awcodes
awcodes6mo ago
Are you updating the file at resources/css/filament/admin/tailwind.config.js? And did you follow the steps in the terminal after running filament:theme?
btx
btx6mo ago
@awcodes thanks, now I understood. In v3 it is necessary to create a theme to use any custom tailwind class. I think this wasn't the case in v2, but I don't really remember since its already 10 months passed protected ?string $maxContentWidth = 'max-w-[1800px]'; is working now, also hot reload 🥹