vincjo / datatables

A toolkit for creating datatable components with Svelte
https://vincjo.fr/datatables
MIT License
372 stars 15 forks source link

Issues with sticky header and footer #20

Closed MoritzHeld closed 1 year ago

MoritzHeld commented 1 year ago

Hi,

I am currently implementing this library in a project of mine. First of all great work! I am trying to make the header and "footer" sticky, but in the documentation the sample code of “basic” and “sticky” is the same (also confirmed it in the SvelteKit code, the file is always the same). The CSS under “tips” also does not work for me.

It would be wonderful if you could explain how the sticky header and footer is meant to be implemented.

Thank you in advance

vincjo commented 1 year ago

Hi,

Sure, thanks for asking. I will complete the documentation to be clearer. Actually the table must be embed into a parent element to make it works

I made a live example in the svelte REPL: https://svelte.dev/repl/bfc8bfc170bb4e3d9af2070dbffb3677?version=3.56.0

There may be limits to explore. I set a height to the parent element but don't know the behavior in case of relative height. If it still doesn't work for you, can you send me an example of your code?

MoritzHeld commented 1 year ago

Thanks for the response and the effort! I will look into it tomorrow and respond here if it worked or not..

MoritzHeld commented 1 year ago

So, as you already mentioned, it works different with a relative height and that was my issue, but I found a workaround for that.. Thanks again for reaching out.. now it works 😎