T
TanStack2y ago
other-emerald

How to configure a column to only be as wide as it's content?

Does anyone know if there's a way to force the first column (the one with the checkbox) to only be as wide as said checkbox?
No description
4 Replies
wise-white
wise-white2y ago
set the header width to be a static value
flat-fuchsia
flat-fuchsia2y ago
just don't use the size properties from TanStack Table at all and rely on the normal semantic table elements CSS width behavior
other-emerald
other-emeraldOP2y ago
Yeah, I'm setting the th and td's width property in CSS, just for that column @mtti.gg ⬆️
wise-white
wise-white2y ago
I'm assuming that isn't working, you may have to set the table-layout to fixed. I know also with the library I use client side needs to have the padding stripped from the cell and header cell, not sure if that is the case for you aswell.

Did you find this page helpful?