ui icon indicating copy to clipboard operation
ui copied to clipboard

Data Table - Columns Definition size property has no effect

Open josh4mento opened this issue 1 year ago • 1 comments

I was messing around with the Data Table component and the different column def properties and found that none of the size properties appear to have any impact on the actual column size. Not sure if it's just me experiencing this problem or if others are too.

This isn't the end of the world as I can define the size by passing an element in the cell property with a width size style but just thought I'd share this experience. Let me know if more information is needed in order to address this.

josh4mento avatar Jan 20 '24 03:01 josh4mento

See here: https://tanstack.com/table/v8/docs/guide/column-sizing

You have to use inline styles on your column header.

style={{ width: `${header.getSize()}px` }}

Philistino avatar Jan 21 '24 11:01 Philistino

Ohhh got it! Thank you @Philistino 🙏

josh4mento avatar Jan 22 '24 15:01 josh4mento