svelte-simple-datatables
svelte-simple-datatables copied to clipboard
Table height is incorrect
My table height gets rendered to height: 88px;
no matter how many rows I have and therefore is unusable as can be seen in the screenshot.
I compared the css styling of https://vincjo.fr/svelte-simple-datatables/#/demo with the table in my project and it seems that in your example the height calculation for the article wrapper works, it is <article class="dt-table" style="height: 344px; overflow-x: auto;">
The height of the table is calculated from the computed height of the parent element. By default the Datatable is first rendered with a minimum height of 160px, then it fits to the container.
2 options:
- define a height for the
div
containing the Datatable - disable Scroll Y in the settings (demo)
For now I have scrollY
disabled yes, but I would like to use it.
Defining a height for the outer div is not a useful solution for me: I cannot know how many rows will be fetched from the backend and if any at all. With a fixed height I would have a e.g. 500px table container without any content...