<HTML> <br/> <pead> <br/> <title> dynamic table </title> <br/> <MCE: script Type = "text/JavaScript"> <! -- <Br/> function addrow (tbodyid) <br/> {<br/> var bodyobj = document. getelementbyid (tbodyid); <br/> If (bodyobj = NULL) <br/>{< br/> alert ("body of table not exist! "); <Br/> return; <br/>}< br/> var rowcount = bodyobj. rows. length; <br/> var cellcount = bodyobj. rows [0]. cells. length; <br/> var newrow = bodyobj. insertrow (rowcount ++); <br/> for (VAR I = 0; I <cellcount; I ++) <br/>{< br/> var cellhtml = bodyobj. rows [0]. cells [I]. innerhtml; <br/> If (cellhtml. indexof ("NONE")> = 0) <br/>{< br/> cellhtml = cellhtml. replace ("NONE", ""); <br/>}< br/> newrow. insertcell (I ). innerhtml = cellhtml; <br/>}< br/> function removerow (inputobj) <br/>{< br/> If (inputobj = NULL) return; <br/> var parenttd = inputobj. parentnode; <br/> var parenttr = parenttd. parentnode; <br/> var parenttbody = parenttr. parentnode; <br/> parenttbody. removechild (parenttr); <br/>}< br/> // --> </MCE: SCRIPT> <br/> </pead> <br/> <body> <br/> <Table> <br/> <tbody id = "tbody1"> <br/> <tr> <br/> <TD> <br/> <input type = "text" size = "40"/> <br/> </TD> <br/> <TD> <br/> <input style = "display: none "mce_style =" display: none "type =" button "value =" delete "onclick =" removerow (this) "/> <br/> </TD> <br/> </tr> <br/> </tbody> <br/> <tr> <br/> <TD> <br/> <input type = "button" value = "add row" onclick = "addrow ('tbody1 ') "/> <br/> </TD> <br/> <TD> </P> <p> </TD> <br/> </tr> <br/> </table> <br/> </body> <br/> </ptml> <br/>