How to add height and overflow properties to react table in bootstrap react?

Viewed 122

I have this bootstrap table in react -

<Table
      striped
      bordered
      hover
      variant="dark"
      className="table"
      style={{ maxHeight: "90vh", overflow: "scroll" }}
>

However, the maxHeight and overflow properties don't seem to work. Even if I use the height prop, the table height is still the same.

One more method, I tried is added a className to the table and then trying it with CSS, even that did not work.

So is there a way I can add height and overflow to a bootstrap table?

1 Answers

I found how you can do that. By wrapping the table by a div which has those properties

So, in this case -

<div style={{ height: '90vh', overflow: 'scroll' }}>
<Table
      striped
      bordered
      hover
      variant="dark"
      className="table"
      style={{ maxHeight: "90vh", overflow: "scroll" }}
/>
</div>
Related