daisyui icon indicating copy to clipboard operation
daisyui copied to clipboard

Feature request: Add the possibility to fix table header row

Open mocdaniel opened this issue 2 years ago โ€ข 5 comments

Hello,

would it be possible to implement a way in which a table's header row is 'pinned' and only the following columns are scrollable?

mocdaniel avatar May 10 '22 13:05 mocdaniel

Hello @saadeghi, May i get assigned this issue?

imtheaman avatar Jun 02 '22 12:06 imtheaman

@urtheaman sure

saadeghi avatar Jun 02 '22 12:06 saadeghi

Thank You.

imtheaman avatar Jun 02 '22 13:06 imtheaman

I'm sorry for being late sir. i'll make the pr today.

imtheaman avatar Jun 10 '22 08:06 imtheaman

No problem! Let me know if I can help

saadeghi avatar Jun 10 '22 09:06 saadeghi

I think @urtheaman is offline, can I get assigned?

xvimnt avatar Mar 20 '23 15:03 xvimnt

@xvimnt There's a PR by @urtheaman (Thanks!): https://github.com/saadeghi/daisyui/pull/918
But honestly I haven't tested it yet.

The challenge:
I can't decide which way it should be.
Currently table's first column (tr>th) is sticky by default and some people asked for a non-sticky column as a default. I'm not sure about how adding these new class names pinned-row and pinned-col should affect that.

  • Maybe we can just remove the default sticky style and make it possible to be sticky by adding these new class names
  • Maybe instead of 2 new class names pinned-row and pinned-col it can be one pinned class. I'm not sure.
  • What happens if many rows and columns have that pinned class? (I haven't tested it yet)

I don't want to add a new style that might create potential problems and then I after people started using it, turns out there were unpredicted issues. At this point I'm not sure which way is the safest way to handle it and I haven't invest time to explore possible downsides because I was focusing on other stuff.

saadeghi avatar Mar 21 '23 17:03 saadeghi