© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
45 replies
Zoltar

custom background columns in table grid

Hello,
Another day another request 🤓

I'm trying to recreate a grid like the attached image
the background color of columns depend by a value stored in $record

my code is below
Immagine_WhatsApp_2024-07-17_ore_17.23.23_9ac82d01.jpg
Solution
->recordClasses(fn (Model $record) => match ($record->id) {
                21 => 'custom-bg-color-black',
                22 => 'custom-bg-color-red',
                23 => 'custom-bg-color-yellow',
                default => null,
            })
->recordClasses(fn (Model $record) => match ($record->id) {
                21 => 'custom-bg-color-black',
                22 => 'custom-bg-color-red',
                23 => 'custom-bg-color-yellow',
                default => null,
            })
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Custom table columns per table tab
FilamentFFilament / ❓┊help
2y ago
Grid and Columns in v4
FilamentFFilament / ❓┊help
8mo ago
Toggle columns grid
FilamentFFilament / ❓┊help
3y ago
Moving columns in table
FilamentFFilament / ❓┊help
13mo ago