F
Filament15mo ago
aliif

How to Make Table Header Col-Span in Filament V3 Table?

Hello, I want to ask how to make a table header colspan or rowspan in filament tble v3, I mean like in attached image. Thank you
No description
3 Replies
toeknee
toeknee15mo ago
I don't beleive you can. You could try using html for the column header and coding in a custom html display
aliif
aliifOP14mo ago
how to do it, I mean combining html with custom livewire and the tablee with filament?
toeknee
toeknee14mo ago
->formatStateUsing(fn($state, $record) => newHtmlString('<div class="grid"><div>' . $record->debit . '</div><div>' . $record->kredit . '</div></div>'))
->formatStateUsing(fn($state, $record) => newHtmlString('<div class="grid"><div>' . $record->debit . '</div><div>' . $record->kredit . '</div></div>'))
or something similiar Yes, just do
->formatStateUsing(fn($record) => $record->index . ' ' $record->allergies)
->formatStateUsing(fn($record) => $record->index . ' ' $record->allergies)
But in doing that you create a single header leader and two columns So try and see if the headers support html.....
->label(fn($record) => new HtmlString('<div style="width:60px;text-align:center;">Allergies</div><div style="width:60px;text-align:center;">Primary</div>')
->label(fn($record) => new HtmlString('<div style="width:60px;text-align:center;">Allergies</div><div style="width:60px;text-align:center;">Primary</div>')
That's very rough adn you'll need an additional row etc but gets an udnerstanding max-width would cause it to wrap overflow-wrap: normal; Nah it's css, we have some css inline which encourages it to be single line if memory serves correctly white-space: normal !important; 🙂 coolio
Want results from more Discord servers?
Add your server