svelte-simple-datatables icon indicating copy to clipboard operation
svelte-simple-datatables copied to clipboard

Table height is incorrect

Open mcmxcdev opened this issue 4 years ago • 2 comments

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;">

Screenshot from 2020-12-11 16-26-28

mcmxcdev avatar Dec 11 '20 15:12 mcmxcdev

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)

vincjo avatar Dec 11 '20 17:12 vincjo

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...

mcmxcdev avatar Dec 17 '20 16:12 mcmxcdev