The main code is as follows:
<Script type = "text/javascript"> <! -- <Br/> function addLabelCol () {<br/> var r = document. getElementById ("labelsample"); <br/> var r0 = r; <br/> var t = _ p (event. srcElement, "table"); <br/> var r1 = t. insertRow (t. rows. length-1); <br/> r1.mergeAttributes (r0); <br/> for (var I = 0, c = r0.cells; I <c. length; I ++) {<br/> var x = r1.insertCell (); <br/> x. innerHTML = c [I]. innerHTML; <br/> x. mergeAttributes (c [I]); <br/>}</p> <p> function _ p (obj, tagNam E) {<br/> tagName = tagName. toUpperCase (); <br/> while (obj. tagName! = TagName) <br/> obj = obj. parentElement; <br/> return obj; <br/>}< br/> function _ e (tr, tagName, name) {<br/> for (var I = 0, c = _ t (tr, tagName); I <c. length; I ++) <br/> if (c [I]. name = name & c [I]. style. display! = "None") <br/> return c [I]; <br/> return null; <br/>}< br/> function _ t (obj, tagName) {<br/> return obj. getElementsByTagName (tagName); <br/>}</p> <p> function removeLabelCol () {<br/> var a = [], B = [], t = _ p (event. srcElement, "table"); <br/> var size = t. rows. length; <br/> var c = document. getElementsByName ("labelFlag"); <br/> var num = 0; <br/> for (var m = 0; m <c. length-1; m ++) <br/> if (c [m]. checked) <br/> num + +; <Br/> if (num <= 0) {<br/> alert ('Please choose which you want to delete! '); <Br/> return false; <br/>} else {<br/> delLabelCol (); <br/>}</p> <p> function delLabelCol () {<br/> var a = [], t = document. getElementById ("labeltable"); <br/> for (var I = 0, c = document. getElementsByName ("labelFlag"); I <c. length-1; I ++) {<br/> if (c [I]. checked) {<br/>. push (I); <br/>}< br/> while (. length & t. rows. length> 2) {<br/> t. deleteRow (. pop (); <br/>}</p> <p> // --> </mce: script> <br/> <body> <br/> <form> <br/> <table id = "labeltable" name = "labeltable" border = "1" width =" 100% "> <br/> <tr align =" left "height =" 20 "> <br/> <td> <input type =" checkbox "name =" labelFlag "value = ""> </td> <br/> <td> Name </td> <br/> <td> Auth </td> <br/> <td> Price </td> <br/> </tr> <br/> <tr align = "left" height = "20"> <br/> <td> <input type = "checkbox" name = "labelFlag" id = "labelFlag" value = ""> </td> <br/> <td> proficient in Ajax collections </td> <br/> <td> Li Gang </td> <br/> <td> 89 </td> <br/> </tr> <br/> <tr align = "left"> <br/> <td colspan = "4"> <br/> <input type = "button" id = "button" value = "AddOne" onclick = "addLabelCol (); "> <br/> <input onclick =" removeLabelCol (); "type =" button "value =" Delete "name =" delButton "id =" delButton "> <br/> </td> <br/> </tr> <br /> </table> <br/> </form> <br/> <table style = "display: none "mce_style =" display: none "> <br/> <tr id =" labelsample "> <br/> <td> <input type =" checkbox "name =" labelFlag "value =" "> </td> <br/> <td> <input type = "text" name = "name"> </td> <br/> <td> <input type = "text "name =" auth "> </td> <br/> <td> <input type =" text "name =" price "> </td> <br/> </tr> <br/> </table> <br/> </body>