ui icon indicating copy to clipboard operation
ui copied to clipboard

How can I make the Actions column of the DataTable stick to the right side of the visible area even when scrolling?

Open geraldodev opened this issue 1 year ago • 3 comments

Hi,

Yesterday, I was investigating the TanStack table and discovered that it has a pinning API feature. You can find more information about it here: https://tanstack.com/table/v8/docs/api/features/column-pinning

Additionally, there is an example available at: https://tanstack.com/table/v8/docs/examples/react/column-pinning However, the example doesn't use sticky columns. Instead, it utilizes three separate tables for the left, center, and right columns.

Initially, I considered placing the Actions column at the beginning, but it seems that most interfaces position it on the right.

So, my question is: Is it possible to implement the desired layout using a single table and the pinning API provided by TanStack?

geraldodev avatar May 17 '23 10:05 geraldodev

following

danielhangan avatar Jul 19 '23 13:07 danielhangan

Hello, any solution for this issue?

suplere avatar Jan 04 '24 10:01 suplere

image Here is how I did it for the left column.

You can also add initial state to keep it always sticky

image

You can abstract it more to use for right column pinning, etc.

daga-segwise avatar Mar 19 '24 11:03 daga-segwise

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jul 01 '24 23:07 shadcn