Reputation: 108
Could it be possible?
I tried:
$("#tbl1 tbody").empty().append(markup)
var tbl = document.getElementById("tbl1")
var lastRow = tbl.rows[tbl.rows.length - 1];
$("#tbl2 tbody").append(lastRow)
Thanks for any help.
Upvotes: 0
Views: 819
Reputation: 386
It's easy all you have to do is check if it's not the last row then remove. Refer below-mentioned code to remove every row except last.
$("table tr:not(:last)").remove()
Upvotes: 3