T
TanStack16mo ago
sunny-green

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
constant-blue
constant-blue16mo ago
set the header width to be a static value
eager-peach
eager-peach16mo ago
just don't use the size properties from TanStack Table at all and rely on the normal semantic table elements CSS width behavior
sunny-green
sunny-greenOP16mo ago
Yeah, I'm setting the th and td's width property in CSS, just for that column @mtti.gg ⬆️
constant-blue
constant-blue16mo 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?