try  
   
  <script   language="javascript">  
  var   bVisible   =   true;  
  function   DisplayColumn(nCol)  
  {  
      var   rows   =   document.all("tbl").rows;  
      for   (var   i=0;   i   <   rows.length;   i++)  
  if   (rows[i].cells.length   >   nCol)  
  rows[i].cells[nCol].style.display   =   bVisible   ?   "none"   :   "";  
   
      bVisible   =   !bVisible   ;  
  }  
  </script>  
  <table   >  
  <thead><th>head   1</th><th>head   2</th><th>head   3</th></thead>  
  <tr><td>1</td><td>2</td><td>3</td></tr>  
  <tr><td>1</td><td>2</td><td>3</td></tr>  
  <tr><td>1</td><td>2</td><td>3</td></tr>  
  <tr><td>1</td><td>2</td><td>3</td></tr>  
  <tr><td>1</td><td>2</td><td>3</td></tr>  
  <tr><td>1</td><td>2</td><td>3</td></tr>  
  </table>  
  <input   type="button"   value="Show/Hide   Column   2"   onclick="DisplayColumn(1);">  

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2021-07-23
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2021-11-05
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案