T
TanStack2y ago
fascinating-indigo

Fixing column width on Shadcn

I am using Shadcn and I am not able to set the columns width, no matter if I try to do it through tableOptions.defaultColumn or individual column defs! Can anyone help me here?
2 Replies
wise-white
wise-white2y ago
In general, you can get the column size like so: width: cell.column.getSize() for <td> cells or width: header.getSize(), for <th> cells. If you need further help, please provide a sandbox of the issue.
wise-white
wise-white2y ago
Column Sizing APIs | TanStack Table Docs
State Column sizing state is stored on the table using the following shape:

Did you find this page helpful?