Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sizing for table columns #337

Open
kaeon opened this issue Apr 13, 2023 · 5 comments
Open

Sizing for table columns #337

kaeon opened this issue Apr 13, 2023 · 5 comments

Comments

@kaeon
Copy link

kaeon commented Apr 13, 2023

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 (saadeghi/daisyui#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>

@dev0T
Copy link
Contributor

dev0T commented Apr 17, 2023

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.

@benjitrosch
Copy link
Collaborator

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.

@kaeon
Copy link
Author

kaeon commented Apr 20, 2023

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

@hjhjdev
Copy link

hjhjdev commented May 4, 2023

Same happening here. Even using tanstack table with react-daisyui, current implementation doesn't allow editing td width.

@kaeon
Copy link
Author

kaeon commented Jun 17, 2023

Does anyone know a workaround for this?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants