http://expert.csdn.net/Expert/topic/1334/1334856.xml?temp=.5802271

解决方案 »

  1.   

    表格有insertRow,insertCell的用法
      

  2.   

    <SCRIPT LANGUAGE="JScript"> //动态增加表格的行和列 
    function rm(){
    if (mytab.rows.length>1){
    mytab.deleteRow(mytab.rows.length-1)
    }
    }
    function add(){
    r=mytab.insertRow();
    r.insertCell().innerText=k;
    r.insertCell().innerText="A";
    r.insertCell().innerText="B";
    r.insertCell().innerText="C";
    r.insertCell().innerText="D";
    //r.ondblclick()="this.style.color='red'";
    } </SCRIPT>
      

  3.   

    简单的例子给你
    <script>
    function add(){
    var or=t.insertRow();
    var oc=or.insertCell();
    oc.innerHTML="ok";
    }
    </script>
    <table width=100 border=1 id=t onclick="add()">
    <tr>
    <td>try</td>
    </tr>
    </table>