假设我的网页从上到下由几个表格组成,如: 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body> 
<table width="1003" border="0" cellpadding="0" cellspacing="0"> 
<!--DWLayoutTable--> 
<tr> 
<td width="1003" height="109" valign="top"><!--DWLayoutEmptyCell--> </td> 
</tr> 
</table> 
<table width="1003" border="0" cellpadding="0" cellspacing="0"> 
<!--DWLayoutTable--> 
<tr> 
<td width="1003" height="109" valign="top"><!--DWLayoutEmptyCell--> </td> 
</tr> 
</table> 
<table width="1003" border="0" cellpadding="0" cellspacing="0"> 
<!--DWLayoutTable--> 
<tr> 
<td width="1003" height="109" valign="top"><!--DWLayoutEmptyCell--> </td> 
</tr> 
</table> 
</body> 
</html>
其中第二个<table>  </table>中的内容是一个广告,我想直接在</html>后面直接添加一些代码使得第二个<table>  </table>中的广告直接隐藏起来,这个代码如何写,不要用按钮的使它显示或隐藏的,直接隐藏这个<table>  </table>中的内容就可以了。

解决方案 »

  1.   

    是在网页的最后面</html>下面修改,我不想在网页中间添加任何代码~~~
      

  2.   

    <body onload="func()">function func(){
      document.getElementsByTagName("table")[1].style.diaplay="none"or  document.getElementById("tableId").style.diaplay="none"
    }
      

  3.   

    如是你自己的网页你可以把第二个TABLE删除或注释掉
    <!---->如果是获取的代码,你可以参考mingxuan3000(铭轩) 的方法:<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body> 
    <table width="1003" border="0" cellpadding="0" cellspacing="0"> 
    <!--DWLayoutTable--> 
    <tr> 
    <td width="1003" height="109" valign="top"><!--DWLayoutEmptyCell--> 1</td> 
    </tr> 
    </table> 
    <table width="1003" border="0" cellpadding="0" cellspacing="0"> 
    <!--DWLayoutTable--> 
    <tr> 
    <td width="1003" height="109" valign="top"><!--DWLayoutEmptyCell--> 2</td> 
    </tr> 
    </table> 
    <table width="1003" border="0" cellpadding="0" cellspacing="0"> 
    <!--DWLayoutTable--> 
    <tr> 
    <td width="1003" height="109" valign="top"><!--DWLayoutEmptyCell--> 3</td> 
    </tr> 
    </table> 
    </body>
    </html>
    <script language="javascript">
    var tableobj = document.getElementsByTagName("TABLE");
    tableobj[1].style.display = "none";
    </script>
      

  4.   

    非常感谢dh20156(风之石),这个已经是可以的了,但是现在还有一个小问题,如果第二个<table> </table>中有几个<td> </td>,想要隐藏第一个<td>应该怎么写。也是用javascript第二个小问题:这里的问题点数:20,应该是给回答正确的朋友的吧,应该如何送分,这个网站是昨天朋友才告诉我的,这里有很多东西我不是很懂,请大家多多指教,谢谢!!!