Horizontal scroll in React Table

Murakami picture Murakami · Aug 29, 2018 · Viewed 14.3k times · Source

I have a problem to get pretty basic functionality, ie. I'd like to set horizontal scroll on React table when the page is less wider then the table size. There is nothing unusual in my code but I'll leave it here anyway:

<ReactTable
  data={bookingPerson}
  columns={columns}
  className="-striped -highlight"
  defaultPageSize={7}
  loading={loading}
/>

Answer

Tamal picture Tamal · Jun 24, 2019

Just simply add style with a height of 400px, that will force it to be scroll able.

<ReactTable
      data={bookingPerson}
      columns={columns}
      className="-striped -highlight"
      defaultPageSize={7}
      loading={loading}
      style={{
        height: "400px"
      }}
 />