вам на самом деле не нужно ни о чем беспокоиться, просто сделайте это просто
создайте s.no со стороны сервера, как показано ниже: json ... тогда вам не нужно беспокоиться о чем-либо вроде смещения
JSON
{
"sEcho": 0,
"iTotalRecords": 12,
"iTotalDisplayRecords": 12,
"aaData": [
["1","item1"],["2","item1"],["3","item1"],["4","item1"],["5","item1"],["61","item1"],["7","item1"],["8","item1"],["9","item1"],["10","item1"],["11","item1"],["12","item1"]
]
}
SCRIPT
<script type="text/javascript">
$(document).ready(function() {
var oTable = $('#category_table').dataTable( {
"aoColumns": [
{ "sClass": "number", "bSortable": false },
{ "sClass": "nonedit", "bSortable": false }
],
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "serverpage.php",
"fnDrawCallback": function () {
}
});
});
</script>
MARKUP
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="category_table">
<thead>
<tr>
<th width="3%" style="text-align:center;">S.No</th>
<th>item Name</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5" class="dataTables_empty">Loading data from server</td>
</tr>
</tbody>
<tfoot>
<tr>
<th width="3%" style="text-align:center;">#</th>
<th>item Name</th>
</tr>
</tfoot>
</table>