0

How do I show the number of rows in a table using react bootstrap table.

Additionally, I am using the search parameter to filter the table, so would like the number of rows to update as the table data is filtered.

SeanPlusPlus
  • 8,663
  • 18
  • 59
  • 84
  • Where are you trying to show the length? Inside the table component, in a parent or in a container? The table's state.data changes with filtering, so you could grab the length of that array. – ryanabooth Oct 15 '16 at 01:19
  • @ryanabooth i would like to show the row count next to the search bar: http://i.imgur.com/Ytixs6F.png – SeanPlusPlus Oct 17 '16 at 19:54
  • do you mean showing the entries like a text not the select button i mean a text like this one (Showing 1 to 10 of 57 entries) at the left of pagination buttons – sasha romanov Jun 25 '19 at 17:29

1 Answers1

0

Just take the length of the data variable that you are giving to the data attribute of the BootstrapTable tag

<BootstrapTable data = {this.props.data}>


this.props.data.length() 

this will give you the size of rows

Basavaraj Hadimani
  • 1,094
  • 12
  • 21