js在table指定tr行上或下面添加tr行

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; 
        } 

 

http://www.cnblogs.com/caicaizi/p/4952551.html

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-07-10
  • 2021-08-27
  • 2022-02-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案