Can someone help me with a simple AJAX pagination in Codeigniter using JQuery? i am retrieving array of rows and i dont know how to paginate it.My AJAX response will be multiple rows and i want to display them in rows of 10 for per page.Kindly help me through.

MY view file 

```
<script>
$(document).ready(function(){
$("#getreport").click(function(){
 var fromdate = $('#date1').val();
 var todate = $('#date2').val();
 $("#header").css("visibility", "visible");
 $("#bodycontent").empty();
 $("#bodycontent").html('<div id="subcontent"></div>');
 data =
{
"from"  : fromdate,
"to" : todate
} 
$.post('<?=site_url("report_controller/managesuppliers_report"); ?>', data  ,function (result) {
for(i=0;i<result["count"];i++){
$('#subcontent').after(
' <tr class="style"> '+
' <td><img src="<?php echo base_url(); ?>/uploads/images/' +result["records"]  [i]["picture"] + '" width="30px" height="30px"></td> '+
' <td>' +result["records"][i]["suppliername"] + '</td> '+
' <td>' +result["records"][i]["contactperson"] + '</td> '+
' <td>' +result["records"][i]["mobilenumber"] + '</td> '+
' <td>' +result["records"][i]["phone"] + '</td> '+
' <td>' +result["records"][i]["email"] + '</td> '+
' </tr> ');
}
});     
});
});
</script>
<div class="panel" id="header" style="visibility: hidden;">
<div class="panel-heading">
<span class="panel-title"></span>
</div>
<div class="table-responsive">
<table class="table allcp-form theme-warning fs13">
<thead>
<tr class="bg-light">
<th class="">Image</th>
<th class="">Supplier Name</th>
<th class="">Contact Person</th>
<th class="">Mobile Number</th>
<th class="">Phone</th>
<th class="">Email</th>
<th class=""></th>
</tr>
</thead>
<tbody id="bodycontent">

</tbody>
</table>
</div>
</div>

```

My Controller File

```
public function managesuppliers_report()
{ 
$query = $this->reportmodel->report_select($this->input->post('from'),$this->input->post('to'));
$data['records'] = $query['records'];
$data['count'] = $query['count']; 
$this->output->set_content_type('application/json');
$this->output->set_output(json_encode($data));
return $data;
}

```

My Model File 

```
public function report_select($date1,$date2)
{
$this->db->where('date >=', $date1);
$this->db->where('date <=', $date2);
$query=$this->db->get('suppliers');
$row = $query->result();
return array(
'records' => $row,
'count' => count($row));
 }

```