Should the wrapping div
on the Table
component exist?
#4484
tjcouch-sil
started this conversation in
General
Replies: 1 comment 1 reply
-
Here are some related PRs: Here's the rationale for the wrapper:
One option would be to keep the wrapper |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello shadcn/ui friends!
The bug reporting page said to open a discussion if I wasn't sure what I was reporting was a bug, so here we are:
If you create a
Table
and addclassName
to it,className
only applies to atable
element inside theTable
component, which has adiv
above it that you can't style. This caused a problem for me when I was trying to useTable
in a flex box and set some flex properties on the table. I needed the properties to apply to the highest element in the table, butclassName
onTable
applies to thetable
inside thediv
.Someone else already reported this as an issue a year and a half ago, but it got closed from inactivity because the author stopped responding: #391
Any thoughts on whether removing the
div
would be a positive or negative? I believe they are both block-level boxes, so I expect this change wouldn't have any layout differences. Of course, I can change my personal code, but this seems more like a divergence from the general design of shadcn/ui components than just a personal thing. I can file a bug if this does appear to be a problem to solve.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions