You can make use of
cloneNode
property to avoid extra efforts. For example -
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.rows[rowCount-1].cloneNode(true);
table.appendChild(row);
Haven't tested this piece of code but I have used this before.
Hope this will help you out..
Regards,
Niral Soni