var theTable = document.getElementsByTagName("table")[0]; //Here close one tr as template var newRowTemplate = theTable.rows[theTable.rows.length-1].cloneNode(true); //Must be tbody, Can not append child to table object var tbody= document.getElementsByTagName("tbody")[0]; function addNewImage(newRowTemplate) { tbody.appendChild(newRowTemplate.cloneNode(true)); // it's now work in IE, but can only add to the last line of the table } add and delete dynamically. Use the below method and oboject to insert row in the table obj.insertBefore(newObj, baseObject);//will insert before baseObject, can inster to any position of the table function insertAfter( referenceNode, newNode ){ referenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );} //JS don't have insertAfter method, somebody made one