Hiding Table Column Labels
Sometimes I use an
imageColumn of viewColumn as the leftmost column in a table. For this column I don't want a label.
I noticed when setting a label with an empty string such as ->label('') the label is not shown however this automatically shows the column toggle menu (top right of table), which seems like an unintended side effect or maybe even a bug.
I can properly hide a label with:
But that seems strange.
Anyone know if filament has a better way of hiding a table column label without showing the toggle menu button?Solution:Jump to solution
@bionary Should be fixed with this PR: https://github.com/filamentphp/filament/pull/18386
GitHub
Dont show colum manager for blank columns without column groups by ...
Background: When column lables are blank and inside a column group, isToggleable() needs to evaluate to true for that column so that, even though the label is hidden in the manager, when the column...
10 Replies
Filament doesn't show a toggle button by default
I guess that you have set all columns to be toggleable by default in a service provider somewhere
if that's the case, then just use
->toggleable(false) for your specific columnI don't have have toggleable() on in a service provider.
It is strange.
If I go to any table and make any table column element have
->label('') the toggle columns menu button appears.I don't think that should be the case. Can you reproduce this on a fresh install?
Hi Dennis,
Just did a fresh install, added one user, then created resource for Users; nothing else.
That toggle shows up when using empty string as label. (perhaps a bug?)

FYI: I went to some older version 3 apps and this does not appear to happen. It seems v4 specific.
Interesting. Does it only show with empty labels? Or do all columns show up? Can you open a bug report on GitHub, please?
@bionary I was able to reproduce this and know where the issue is coming from. I have some other column manager issues to take care of so I'll add this to the list.
In the meantime if you need a quick solution you can add
->columnManager(false) to your table and it will force hide the column manager.Solution
@bionary Should be fixed with this PR: https://github.com/filamentphp/filament/pull/18386
GitHub
Dont show colum manager for blank columns without column groups by ...
Background: When column lables are blank and inside a column group, isToggleable() needs to evaluate to true for that column so that, even though the label is hidden in the manager, when the column...
Wow! You're fast! Thank you.