function hidTr(rowIndex) {
   var tb = document.getElementById("tableId");//get the table you want
   if (tb.rows[rowIndex]) {
         tb.rows[rowIndex].style.display = "none";
   } else {
          alert("The rowIndex is invalid!"); 
   }
}

解决方案 »

  1.   

    就定义一个tr的id,然后设置 style.display='none'就可以了
      

  2.   

    请问display和visibility有什么区别啊?如果是要显示或者隐藏一个列呢?
      

  3.   

    display基本上就是从页面上删除这部分内容
    visibility只是隐藏,但元素所占的空间还是保留的
      

  4.   

    <tr id="hiddenMe"><td></td></tr>function hiddenTR() {
      document.all.hiddenMe.style.display="none";
    }
      

  5.   

    <tr id="hiddenMe"><td></td></tr>function hiddenTR() {
      document.all.hiddenMe.style.display="none";
    }
    这个只是一行一行的删除 我想一列一列的显隐 请问有什么 办法吗?