table layout styling
So whenever I implement layout functionality such as Split or stack. The entire table just keels over.
Example

25 Replies
It should only stack the name and username fields?
Also all toggleable columns dont seem to have its functionality when using Stack, Split etc
Another example, where it's just all over and messy
Nothing is aligned

@Jamie Cee Did you manage to figure this out?
Not aligned how?
you can see in the last screenshot, columns are not aligned, i have similiar results
Oh. You mean “column” width? That’s because using splits and stacks it is not an actual table anymore. See https://filamentphp.com/docs/3.x/tables/layout#controlling-column-width-using-a-grid
@awcodes i tried this as well, however it creates alot more work to get everything right and its breaks other things such as ->defaultSort('name').
Is there no other options for a simple stack just to get 2 columns stacked vertically?
Not really. When you use stacks and splits it is no longer rendered as an actual html table but rows of flex items. So the only way to force even widths is with a grid or possibly more complicated with css in a theme.
@awcodes i came across this thread from last year for the same topic and someone managed to find a work around, however it does not appear to be working, was it maybe for filament2?
https://github.com/filamentphp/filament/discussions/12061
if you dont want to go through that post the final solution was

Hmm, I’m surprised that ever worked because it would create an invalid html structure.
oh i actually just got it to work
it makes the row very long though

But you could do that with formatStateUsing() and returning either p tags or just a string with br tags.
I wouldn’t nest actual columns like in the issue though.
ok will look into that, thanks.
I am currently moving over from Nova to Filament and so far this is the only thing that was more friendly on Nova. you can just Stack::make anywhere in your table
Nesting the columns would put td tags inside td tags which isn’t valid html and would lead to accessibility issues.
Fair, but in filament stacks are designed to be used inside of splits or grids.
yeah i am seeing that, would be cool to have it available as a column type
but thanks for your advise 👍
I hear you, but having to generate recursive nested table inside table cells with all the methods and action would end up being a nightmare and possibly huge performance implications in v3.
Probably a lot easier in nova since it’s vue. So no heavy rerendering on the livewire side.
right, that makes sense
@awcodes did you mean something like this? i had to use getStateUsing because formatStateUsing isnt working for some reason.
TextColumn::make('customer_details')
->label('Test')
->getStateUsing(fn ($record) => "{$record->model_number} <br> {$record->status}")
->html(),
Yea. That looks right. I think format is on inputs. Sorry
all good, Thanks 👍
Did that work for you?
yeah its the best solution i have tried so far
Glad it worked. Probably the best approach to keep things semantic and accessible in the html.
cool, thank you 👍