up   up  !!!!!!!!

解决方案 »

  1.   

    <html>
    <SCRIPT> 
    function insertTable() 

    me = document.all.tb;
    var o = null;
    var o = me.insertRow();
    var c = me.rows(0);
    for(var i=0;i<c.cells.length;i++){
    e = o.insertCell();
    e.align = c.children[i].align;
    e.width = c.children[i].width;
    e.innerHTML = c.children[i].innerHTML;
    }

    </SCRIPT>
    <body>
    <TABLE id="tb" width="100%" height="80%">
    <TR>
    <TD align="center" width="50%">标题1</TD>
    <TD align="center" width="50%">标题2</TD>
    </TR>
    </TABLE> 
    <INPUT type=button value="add" onclick="insertTable()"> 
    </body>
    </html>
      

  2.   

    引用style集合的属性来设置
    --------------------------
    <SCRIPT> 
    function insertTable() 

      var row = document.all("tb").insertRow(); 
      row.style.textAlign = "center"
      var cell = row.insertCell(); 
      cell.innerHTML = '标题1'; 
      cell.style.fontWeight = "bold"
      cell = row.insertCell(); 
      cell.innerHTML = '标题2'; 
      cell.style.fontWeight = "bold"

    </SCRIPT>
      

  3.   

    up up !!!多谢了 kel(空心菜)  xjdawu(无法界定)  ,  感谢至极!!!
    up  up!!!!!!!!!^--^  !!!