function onAddTR(trIndex)
{
var tb = document.getElementById("tb1");
var newTr = tb.insertRow(trIndex);//添加新行,trIndex就是要添加的位置
var newTd1 = newTr.insertCell();
newTd1.innerHTML = "这是新行,位置:" + trIndex;
var newTd2 = newTr.insertCell();
newTd2.innerHTML = "这是新行,位置:" + trIndex;
}
请参考采纳,谢谢!
var table = document.getElementById("tableId");
table.innerHTML = table.innerHTML + "...... ";