React / Initial Number of Rows

Tags: #<Tag:0x00007efc61616bd8>

I want to set the table to show 5 lines independent of the content. If less, show empty lines, if more, show scroll bar.

I currently use:

        <HotTable id="a" 
          data={hotData}
          columns={
            [
              {data: 'a'},
              {data: 'b'},
              {data: 'c'},
              {data: 'd'},
            ]
          }
          colHeaders={['X', 'Y', 'Z', 'Q']}
          rowHeaders={true}
          height='auto'
          licenseKey="non-commercial-and-evaluation"
        />

This creates a table that as many lines as the data needs and adjusts its size.

I want to avoid fiddling around finding out a number in pixel that shows 5 lines. I can use minRow to get an initial size, but the table will expand if there is data for more rows. Using maxRow strips more data.

Hi @robert.muench

there is no detection mechanism for that. The option that sounds the best would be to set max-height but it is not available yet. We have discussed the subject here https://github.com/handsontable/handsontable/discussions/7943 and https://github.com/handsontable/handsontable/discussions/7925