A sticky and on top <TableHeader /> component
I’m using shadcn’s data table components built on TanStack Table, and I’m trying to make the <TableHeader /> sticky so it stays on top of the rows. However, I haven’t been able to get it working properly without breaking the styling or running into an issue where the header and rows become misaligned when horizontally scrolling.
How can I correctly make the table header sticky while keeping the header and rows aligned during horizontal scroll?
I kept the snippet brief and removed most for readability, but I’m happy to share more details if needed.
0 Replies