in datatables total rows is not coming correct code example Example: datatable count number of rows var table = $('#example').DataTable(); table.rows().count();