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
awcodes2y ago
extraAttributes([‘style’ => ‘width: 1px’]) Or a class of w-px if you safelist it in your tailwind config.
Saade
SaadeOP2y ago
Thanks Adam, but where should i put the extra attribute? since i don't have access to the checkbox column?
awcodes
awcodes2y 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
SaadeOP2y 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
awcodes2y ago
yea, that's odd, that's for form components it might only apply to the table grid layout too
Dan Harrin
Dan Harrin2y ago
it looks like a bug rather than something you should fix cc @zepfietje
Saade
SaadeOP2y 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 Fietje2y ago
Should be fixed by my work earlier today. Pull in 3.x and verify if you like, @saadeguilherme. 🙂
Saade
SaadeOP2y ago
Thanks Zep! Will take a look after lunch
Saade
SaadeOP2y ago
@zepfietje looking good! The only thing now is the checkbox <td> taking 1/4 of the table
Zep Fietje
Zep Fietje2y ago
That's always been like that, right? Simply how tables lay out their columns.
Saade
SaadeOP2y ago
A simple w-1 in tables/resources/view/index does the trick
Saade
SaadeOP2y ago
quote
Dan Harrin
Dan Harrin2y ago
yeah i think we used to have a fixed width for this one Zep
Saade
SaadeOP2y ago
Saade
SaadeOP2y 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
SaadeOP2y ago
like that
Zep Fietje
Zep Fietje2y ago
Oh only now I see it doesn't make sense. 😂
Solution
Zep Fietje
Zep Fietje2y ago
This has been fixed on 3.x now, @saadeguilherme!
Saade
SaadeOP2y ago
Thanks Zep! Sorry for bothering you
Zep Fietje
Zep Fietje2y ago
No worries. Thank you for reporting!

Did you find this page helpful?