添加行可以用
var NewRow = TableObj.insertRow(RowInsert);
RowInsert表示添加到的位置,为-1时表示添加到表最后一列
添加列可以用
var NewCol = Row.insertCell(CellInsert);
CellInsert意义同RowInsert
然后可以直接操作
NewCol的innerHTML
var NewRow = TableObj.insertRow(RowInsert);
RowInsert表示添加到的位置,为-1时表示添加到表最后一列
添加列可以用
var NewCol = Row.insertCell(CellInsert);
CellInsert意义同RowInsert
然后可以直接操作
NewCol的innerHTML
R=document.getElementById("sb").insertRow();
C=R.insertCell();
C.innerHTML="tr><td><input width='90' type='text' size='13' maxlength='15' style='border:0px;text-align:center;color:#3300FF' readonly></td></tr>";}
sb为表格名称