完整,最好是经过测试的!

解决方案 »

  1.   

    具体的情况千差万别,在此仅提供一个思路:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title><script  src="http://code.jquery.com/jquery-latest.js"></script>
    <style>
    table{border:solid 1px red;}
    td{width:200px;height:20px;border:solid 1px black}
    </style>
    <script>
    $(function(){
    $('#Button1').click(function(){
    $('#temp_tab tr:first').clone(true).appendTo('#temp_tab')
    })
    $('#Button2').click(function(){
    $('#temp_tab tr').prepend('<td></td>')
    })
    $('#temp_tab button').click(function(){
    $(this).parents('tr').remove()
    })
    $('#Button3').click(function(){
    $('#temp_tab tr').each(function(){
    $(this).children('td:first').remove()
    })
    })
    })
    </script></head><body>
    <table id="temp_tab"><tr><td></td><td><button>删除行</button></td></tr></table>
    <button id="Button1">添加行"</button>
    <button id="Button2">添加列"</button>
    <button id="Button3">删除列"</button></body>
    </html>
      

  2.   

    http://download.csdn.net/detail/woshilifeng130/3547132
    到csdn下载上边下吧 这个只需要1个下载分 没有的话 用5个可用分去兑换一下
      

  3.   

    <HTML>
    <SCRIPT LANGUAGE="JScript">
    function numberCells() 
    {
        var count=0;
        for (i=0; i < document.all.mytable.rows.length; i++)
        {
            for (j=0; j < document.all.mytable.rows(i).cells.length; j++) 
            {
                document.all.mytable.rows(i).cells(j).innerText = count;
                count++;
            }
        }
    }function tb_addnew()
    {
    var ls_t=document.all("mytable")
    maxcell=ls_t.rows(0).cells.length;
    mynewrow = ls_t.insertRow();
        for(i=0;i<maxcell;i++)
        {
        mynewcell=mynewrow.insertCell();
        mynewcell.innerText="a"+i;    }
    }function tb_delete()
    {
    var ls_t=document.all("mytable");ls_t.deleteRow() ;
    }</SCRIPT>
    <BODY onload="numberCells()">
    <TABLE id=mytable border=1>
    <TR><TH> </TH><TH> </TH><TH> </TH><TH> </TH></TR>
    <TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
    <TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
    </TABLE>
    <input type=button value="新增" onclick="tb_addnew()">
    <input type=button value="删除" onclick="tb_delete()" >
    </BODY>
    </HTML>