Search code examples
reactjsreact-bootstrapreact-bootstrap-table

React BootstrapTable how to set row count per page?


I am using react react-bootstrap-table. The default count of row is 10 per page. I want to change it to 5. How can I do this?


Solution

  • react-bootstrap-table has this follow attributes to change the limit per page.

    sizePerPageList: [20, 50, 100],
    onSizePerPageList: this.onSizePerPageList.bind(this), //number of items to be displayed
    onPageChange: this.onPageChange.bind(this), //pagination tours
    

    you can use bind a function on onSizePerPageList to change the state variable that holds your limit.