如题<table>
<tr>
<td><input type='button'/></td>
</tr>
<tr>
<td><input type='button'/></td>
</tr>
<tr>
<td><input type='button'/></td>
</tr>
<tr>
<td><input type='button'/></td>
</tr>
</table>

解决方案 »

  1.   

    给Table赋值个ID,或者TR赋值个ID。var tb=document,getElementById('tbID');
    table.deleteRow(0)//这里的数字是行的索引
      

  2.   

    var tb=document,getElementById('tbID'); 
    tb.deleteRow(0)//这里的数字是行的索引
      

  3.   

    用DOM對象模型
    <table id='tab'>
    <tr>
    <td><input type='button' onclick='Delete(this.parentNode.parentNode);'/>
    </td>
    </tr></table>
    this.parentNode.parentNode=tr节点
    注意:有时候IE会把空格当成一个节点,所以你要具体调试下才清楚.大致方法是这样的
    function Delete(theRow)
    {
       document.getElementById("tab").removeChild(theRow);
    }
      

  4.   

     <input type='button' onclick='Delete(this.parentNode.parentNode);'/> 
    这个this.就是表示当前按钮,this.parentNode.parentNode就表示当前按钮的父节点的父节点
    就是TR了,明白不
      

  5.   

    参数无效,你试试在函数前面加上debugger;js调试进去看下,是哪个对象为nullfunction Delete(theRow) 

      document.getElementById("tab").childNodes.removeChild(theRow); 
    }发现了,少加了个childNodes属性
      

  6.   

    我说的都说到份上了,你应该多少了解Dom模型的思想吧..
    debugger调试下
      

  7.   

    table内的每一行末有一个按钮,如何通过点击该按纽取得当前表格的行数! 
    用JS实现!
      

  8.   

    document.getElementById("tab").deleteRow(obj.parentElement.parentElement.rowIndex);
      

  9.   


      <tr> 
         <td> 
       <input type="button" value="删除" onclick="javascript:this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);" />
         </td> 
      </tr> 
      

  10.   

    <table>
    <tr>
    <td> <input type='button' onclick="delRow(this)"/> </td>
    </tr></table>
    function delRow(obj)
    {
     var Row=obj.parentNode;
     while(Row.tagName.toLowerCase()!="tr")
     {
     Row=Row.parentNode;
     }
     Row.parentNode.removeChild(Row);//删除行}
      

  11.   

    想到问题了..
    <table><tr><td></td></tr></table>
    在IE6会强行在<table>下加一个<tbody>标签,所以
    你自已强行在<table>下加一个<tbody>标签
    <table><tbody><tr><td>.....</td></tr></body></table>
    然后将函数改为
    function Delete(theRow) 

      document.getElementById("tab").childNodes[0].childNodes.removeChild(theRow);