How to set the table adaptive width and height

Tags: #<Tag:0x00007fa999534810>

How to set the table adaptive width and height

Hey @jksoncao

In Handsontable you can set a fixed height and width for a whole table, column and a row.

What exactly you’d like to do?

I want the width and height of the table to change automatically based on the content, and it is full of


Currently the table grows with the content

but you cannot set min-height and max-height. There’s only default (expanding option) and fixed size.

I want to the table’s width and height adaptive based on the size of the wrap div

Hey @893851602

the only way to get this done is to call updateSettings each time a text gets more space in a cell and rows/columns get inserted/deleted.

Set width and height to 100%. Since v7 Handsontable will adapt whenever windows is resized. If you’re changing layout any other way you have to call refreshDimensions() method manually. Or implement any technique or polyfill for Element Queries to detect when div dimensions were changed. There is currently no API in the browser to do it out of the box and implementations may vary so it’s left up to the developer.