I am using the html table. I want to insert a new row to that table dynamically like button click. I was tried like this,
var rows = $(this.element).find("tbody").find("tr");
prevElem = rows[index];
$("<tr><td>data</td><tr>").insertBefore(prevElem);
But, it doesn’t work. How to insert new row at the specified index?
Thanks in advance,
-Raja.
Have a look here:
I have done a working example of inserting a row before an element.