Reputation: 27
Here is the code, what it is doing right now is adding data to the table? Here it the sample code..I have the table with data already..when I add another item it should add as a first row...right now it is adding after the existing data..any suggestions..
EDIT
Upvotes: 0
Views: 154
Reputation: 82241
Use prepend instead of append.
$("#datatable").prepend(tr);
Upvotes: 0
Reputation: 17550
Use
$("#datatable").prepend(tr);
instead of
$("#datatable").append(tr);
in line 12.
Upvotes: 0