如何隐藏指定的表格

来源:百度知道 编辑:UC知道 时间:2024/07/07 23:14:45
如何使用javascritp隐藏红色的表格,建议参考下:http://zhidao.baidu.com/question/18644674.html
<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'><tr>
<td height='22' colspan='5'> </td>
</tr>
<tr><td height='30'> </td>
</tr>
</table>
<br><table width='100%'><tr><td align='left'> </td>
</tr></table><form><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr align='center'>
<td> </td>
</tr>
</table>
<table width='100%' border='0' align='center' cellpadding='5' cellspa

用JavaScript控制页面的一个元素为隐藏,其实基本思想是:将该元素的CSS样式的display属性值设为none就可以了.楼主的问题中的那个链接中的回答已经可以实现了你的功能了.比如你要将所有隐藏的单元格用JS隐藏,可以给每个单元格命名一下,将上面相关代码更改如下
<!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=gb2312" />
<title>无标题文档</title>
</head>

<body>
<div id="all">
<table width="100%">
<tr bgcolor="#FF0000" id="hide_1"><td>隐 藏1111111</td><td>隐 藏1111111</td>
</tr><tr bgcolor="#FF00