react-table-library icon indicating copy to clipboard operation
react-table-library copied to clipboard

Table always take the max height of container div

Open andra961 opened this issue 2 years ago • 3 comments

Basically, even if the table has only 2 rows, all the container space will be occupied and the header + 2 rows will each be very big in height(1/3 of the container each). I'm using tree table, is there a way to prevent this or specify a fixed height for each row(and header too)?

andra961 avatar Feb 21 '23 12:02 andra961

Hello, I had the same problem. I solved it by using the custom theme. For the rows set table: grid-template-rows: 50px. And the header HeaderCell: height: 50px for example. Whether it's the perfect solution I don't know, but it works for me.

Levi2709 avatar Feb 24 '23 08:02 Levi2709

Hello, I had the same problem. I solved it by using the custom theme. For the rows set table: grid-template-rows: 50px. And the header HeaderCell: height: 50px for example. Whether it's the perfect solution I don't know, but it works for me.

I tried it and it didn't work. Did you use --data-table-library_grid-template-rows: 50px; or just grid-template-rows: 50px? Btw i solved it by adding height: auto; and max-height: 100% in Table, don't know if there's a better way too.

andra961 avatar Mar 16 '23 17:03 andra961

thanks @andra961 - just what I needed for my issue in https://github.com/table-library/react-table-library/discussions/122

proddy avatar May 10 '23 20:05 proddy