How can i set max width for text column in table
Hi filament community, how can i set max width for column 'name'.
i try to add class max-w-xs, but if below description is too long will break ui.
I want when below description is too long, it will go next line.
How can i solve this case? I dont want to set limit words to below description
Here is my code
12 Replies
?
it not work
break-all ?
not work too. result same as break-words
?
Try
word-wrap: anywhere;
both above way not work @Leandro Ferreira @ChesterS
Hmm that might be a limitation with tables, but I'm not an expert on CSS so...
If you wrap your table columns in a
Split::make([...])
it should work (but then you're losing some of the features so it's up to you if it's worth it)I don't know why..
Maybe you could use another way https://filamentphp.com/docs/3.x/tables/layout#controlling-column-width-using-a-grid
Your '
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
is 70 characters. Not many words are actually that long. Highly unusual to have no white-space or punctuation which would cause normal wrapping to function with ->wrap()
I"m not saying your use-case isn't valid. Just unusual IMO.
Are you actually displaying non-breaking content that you're trying to force-wrap? I'm trying to understand your use-case better. Maybe there's another approach available by re-thinking?
On all the tables I've used TextColumns in I've always been able to just use wrap()
... whether that's for the column's normal state
value, or for a ->description(fn ($record):string....)
that is often long as well.
That said, you're right: there's no (er, I haven't found a) settable max-width for said columns.thank you guys, for some reason it worked as my expectation