How to create new row at middle of the table
How to create new row at middle of the table
![dhanu](https://secure.gravatar.com/avatar/0f6b844ca946c16ff2a5ee2b40e34908/?default=https%3A%2F%2Fvanillicon.com%2F0f6b844ca946c16ff2a5ee2b40e34908_200.png&rating=g&size=120)
I am using datatables 1.9.4 version,
how to create new row at middle of the table
i tried based on http://datatables.net/forums/discussion/11899/unable-to-add-row-in-the-middle-of-a-data-table/p1
but not working.
how to create new row at middle of the table
i tried based on http://datatables.net/forums/discussion/11899/unable-to-add-row-in-the-middle-of-a-data-table/p1
but not working.
This discussion has been closed.
Replies
$("#sellIn").dataTable({
"sPaginationType": "full_numbers",
"bPaginate": true,
"bJQueryUI": true,
"bAutoWidth": true,
"bFilter": false,
"bSort":false,
"aaSorting": [[0,'asc']],
"aaSortingFixed":[ [0,'asc']],
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
]
});
var oTable = $("#sellIn").dataTable();
var oSettings = oTable.fnSettings();
var oData = $('#sellIn').dataTable().fnSettings().aoData;
var oDisplayMaster = $('#sellIn').dataTable().fnSettings().aiDisplayMaster;
var oDisplay =$('#sellIn').dataTable().fnSettings().aiDisplayMaster;
var affectedRowNbr = 1; //childTd.parentNode.parentNode.rowIndex-1;
var ind = affectedRowNbr+1;
var newTr = " ";
newTr += "test0test1test2test3test4test5";
newTr += "";
var nTr = $(newTr)[0];
var nTds = nTr.getElementsByTagName("td");
var aData = [];
for ( var j=0 ; j