//Dynamicly add rows function addRow(){ var table = document.getElementById("tableID"); var newRow = table.insertRow(); //Create New row var newCell1 = newRow.insertCell(); //Create a new cell newCell.innerHTML = ""; //Contents in the cell newCell.setAttribute("align","center "); //Set position }
//Dynamicly delete rows function deleteRow(){ var rowIndex = event.srcElement.parentElement.parentElement.rowIndex; var styles = document.getElementById("tableID"); styles.deleteRow(rowIndex); }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn