JS Dynamic Control Form table, here to speak only, add a row, delete a row, delete a row of a column.
Directly put the code:
<! DOCTYPE html><!--here is an interesting thing, for= "Cao", and then <input/> Add ID to Cao, you click here Text, will prompt you in input--><p><label for= "Cao "> Name is what, click I can go inside the box: </label><input type=" text "id=" Cao "/></p></form><script> Window.onload = function () {/* Creates a row, executes the Chuang () function */chuang ();/* Deletes a row, or a column of one row, executes the Dete function/dete (); function Chuang () {var tab = document.getElementById ("tabl");/* takes the object to be manipulated */var tr = Tab.insertrow (2);/* Adds a row with ordinal 2 to it */var Ptext = new Array ();/* Create number of text node groups */ptext[0] = document.createTextNode ("Black Pig"); PTEXT[1] = document.createTextNode ("998342"); for (var i = 0; i < ptext.length; i++) {/* traverse */var cd = Tr.insertcell (i);/* Press The ordinal creates the column */cd.appendchild (Ptext[i]);/* Adds a text node to the corresponding column/}} function Dete () {var tab = document.getElementById ("Tabl"); Tab.deleterow (4);/* Deletes a row */tab.rows[3].deletecell (1);/* Deletes a row of a column */}}</script></body>
JS Dynamic Control Form table