T
TanStack17mo ago
magic-amber

How to limit the row of table being shown?

Is there a way to limit the rows being shown in my website? The problem I have is the default value rows i 10, it is possible to limit it to 5? I'm following this tutorial provided by shadcn-ui https://github.com/shadcn-ui/ui/blob/main/apps/www/app/(app)/examples/tasks/components/data-table-pagination.tsx
GitHub
ui/apps/www/app/(app)/examples/tasks/components/data-table-paginati...
Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source. - shadcn-ui/ui
2 Replies
flat-fuchsia
flat-fuchsia17mo ago
Did you try setting pageSize like in this example? https://github.com/TanStack/table/discussions/2029#discussioncomment-4860455
GitHub
How to set default page size? · TanStack table · Discussion #2029
Hi, How can I initially set default page size to be 15?
magic-amber
magic-amberOP17mo ago
It works, but I have a problem, the rows per page doesn't work anymore once I set it. oh nevermind, I just didn't type it properly, Thanks a lot ~~!!

Did you find this page helpful?