xwl1991 发表于 2013-2-7 15:14:29

动态创建 table row cell ( insertRow ,insertCell )

1
 
 
function add(){      var obj = document.getElementById("tbl");      var newRow = obj.insertRow(0);      var newCell = newRow.insertCell(0);      var clonetd = obj.rows.cells.cloneNode(true);            newCell.innerHTML = clonetd.innerHTML;                        //obj.deleteRow(1);}  
 
2
 
 
<table id="tbl"><tr>          <td>钓鱼岛是中国的!<input type="text" value="" /></td>      </tr></table><a >add</a>  
 
 
3
 
页: [1]
查看完整版本: 动态创建 table row cell ( insertRow ,insertCell )