<table>
<tr>
<td style="display:none">A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td style="display:none">A1</td>
<td>B1</td>
<td>C1</td>
</tr>
</table>
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8">
</head>
<body>
<script language="JavaScript">
function show(){
document.getElementById("table").style.display='block'
}
function hide(){
document.getElementById("table").style.display='none'
}
</script>
<style>
td{border:1px solid #369}
</style>
<table id="table" cellspacing="0" cellpadding="5" style="">
<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>
<br>
<input type="button" value="关闭table" onclick="hide()">
<input type="button" value="显示table" onclick="show()">
</body>
</html>
<table width="100" border="0" cellspacing="0" cellpadding="0" style="visibility:hidden"><tr>
<td bgcolor="#00FF00"></td>
</tr>
</table>
style="visibility:hidden">隐藏
style="visibility:display">显示
<table width="100" border="0" cellspacing="0" cellpadding="0" style="display:none">
<tr>
<td bgcolor="#00FF00"></td>
</tr>
</table>
style="display:none" 隐藏
style="display:''"显示
也可以通过程序判断实现此功能Top
那么如何来标识一个表格呢?Top
ID,
document.getElementByIdx()....Top
<TD id=sayou style="DISPLAY: none" width=211>页面浏览:</td>
Top
//JavaScript这样调用
if (sayou.style.display=="none"){sayou.style.display="inline"}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)