2014-02-17

jQuery DataTables: How to get total rows



Given the DataTables initialization below:



I had to get the total number of rows to display elsewhere in the page. I didn't want to rely on "Showing X to Y of Z entries", as I wanted it much higher in the page.

The solution was extremely simple:



With that little bit of code I could show the user how many records I had for them before they saw the table.