table加個name
用insertrow和insertcell方法來創建行和列

解决方案 »

  1.   

    trRow = tbBoard.insertRow(0);
    tbCell=trRow.insertCell(1);
    tbCell.colSpan=5;
       tbCell.bgColor="#99CCFF";
       tbCell.align="center";
       tbCell.style.cssText = "cursor:default";
      

  2.   

    恩 这个好像我还不能用,
    我是得到了一个xml数据,用xsl解析成如
        <tr id=1tr ><td>11111111111111</td></tr>
        <tr id=2tr ><td>22222222222222</td></tr>
        <tr id=4tr ><td>44444444444444</td></tr>
    这样的html代码,然后再插入到行与行之间的,直接用对象操作,怕还是不行。
      

  3.   

    --字符串操作,很烦
    --让浏览器render后再来,很方便
      

  4.   

    <table id="table1">
        <tr id=1tr ><td>11111111111111</td></tr>
        <tr id=2tr ><td>22222222222222</td></tr>
        <tr id=4tr ><td>44444444444444</td></tr>
    </table><script>
    document.all.table1.insertRow(2);
    document.all.table1.insertRow(2).id="3tr ";
    document.all.table1.rows[2].insertCell(0);
    document.all.table1.rows[2].cells[0].innerHTML="333333333333333";
    </script>