Dynamic row count on Datatable component? #4060
Unanswered
dominic-henley
asked this question in
Q&A
Replies: 1 comment
-
The pagination component always remains after the last row, whether you have 10, 20, or 50 rows. I don't know what your code looks like. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone, just started using shadcn and loving it so far. I'm looking to implement a datatable and I've been following the short tutorial on the documentation page. The pagination works well however it defaults to 10 rows. This leaves a big gap between the pagination controls and the datatable itself. I've attached a screenshot of the datatable in question.

I was wondering if there's a way to determine the number of rows per page dynamically?
I've thought about setting the number of rows manually by taking the height of the table assuming it's taking up the whole space and dividing by the number of rows + header but I'm not sure if the height of the rows will be guaranteed to be the same everywhere.
Anyone have any suggestions? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions