react-daisyui
react-daisyui copied to clipboard
Sizing for table columns
How can we set fixed or max sizing for table columns? I read for daisyui you have to do this with min-width and max-width on the table cell td elements (https://github.com/saadeghi/daisyui/discussions/532) but I can't figure out how to control the classnames for td elements with following <Table.Row>
<Table.Row hover > <span>col1</span> <span>col2</span> <span>col3</span> </Table.Row>
Reading the library's code, the current implementation of Table.Row
doesn't allow a className
to be provided to the cells specifically. In this case I believe you would achieve what you want by providing the className
to the span
tags.
I'm not in love with how Tables are designed at the moment. We could expose a cellClassNames
prop, but then different cells would want different styles etc... Any way I can think of to deal with this feels like a hack. Probably best to just tear out the existing logic and make something like a <Table.Cell>
component.
I'm not in love with how Tables are designed at the moment. We could expose a
cellClassNames
prop, but then different cells would want different styles etc... Any way I can think of to deal with this feels like a hack. Probably best to just tear out the existing logic and make something like a<Table.Cell>
component.
Something like <Table.Cell> seems logical indeed
Same happening here. Even using tanstack table with react-daisyui, current implementation doesn't allow editing td width.
Does anyone know a workaround for this?