F
Filament12mo ago
Saade

Prevent table checkbox from growing

How do i prevent this (checkbox td growing) from happening?
Solution:
This has been fixed on 3.x now, @saadeguilherme!
Jump to solution
21 Replies
awcodes
awcodes12mo ago
extraAttributes([‘style’ => ‘width: 1px’]) Or a class of w-px if you safelist it in your tailwind config.
Saade
Saade12mo ago
Thanks Adam, but where should i put the extra attribute? since i don't have access to the checkbox column?
awcodes
awcodes12mo ago
if you don't have access to it then you'd have to fnd some way to target it with CSS or you could specify a min-width/full-width on the name column probably
Saade
Saade12mo ago
shouldn't ->columnSpanFull() on the name column work in that case? cause it's not i don't get it why there's columnSpan stuff on the columns since they don't affect columns at all
awcodes
awcodes12mo ago
yea, that's odd, that's for form components it might only apply to the table grid layout too
Dan Harrin
Dan Harrin12mo ago
it looks like a bug rather than something you should fix cc @zepfietje
Saade
Saade12mo ago
Well, since you tagged him, @zepfietje as seen on the image, the bulk checkbox has a ps-6 (1.5rem) padding while the record checkbox has a px-4 (1rem) padding, so they're not aligned as it was in v2
Zep Fietje
Zep Fietje12mo ago
Should be fixed by my work earlier today. Pull in 3.x and verify if you like, @saadeguilherme. 🙂
Saade
Saade12mo ago
Thanks Zep! Will take a look after lunch
Saade
Saade12mo ago
@zepfietje looking good! The only thing now is the checkbox <td> taking 1/4 of the table
Zep Fietje
Zep Fietje12mo ago
That's always been like that, right? Simply how tables lay out their columns.
Saade
Saade12mo ago
A simple w-1 in tables/resources/view/index does the trick
Saade
Saade12mo ago
quote
Dan Harrin
Dan Harrin12mo ago
yeah i think we used to have a fixed width for this one Zep
Saade
Saade12mo ago
Saade
Saade12mo ago
I know its how tables behaves, but it does not make sense to have a table looking like that or... we can extract the checkbox from blade to the $table->columns(), and let people customize using $table->getRecordCheckboxColumn()->label('Plz select')
Saade
Saade12mo ago
like that
Zep Fietje
Zep Fietje12mo ago
Oh only now I see it doesn't make sense. 😂
Solution
Zep Fietje
Zep Fietje12mo ago
This has been fixed on 3.x now, @saadeguilherme!
Saade
Saade12mo ago
Thanks Zep! Sorry for bothering you
Zep Fietje
Zep Fietje12mo ago
No worries. Thank you for reporting!