<tr id="importDiv"><td></td><td></td></tr>
有多列时
document.getElementById("importDiv").style.display = "block";
在ie下是对的
在firefox下,布局就乱了,tr正行会缩到第一个td里面我试了多中方法都不管用
document.getElementById("importDiv").style.display=" ";
document.getElementById("importDiv").style.cssText="display:‘ ’";请指教!小弟先谢过!
有多列时
document.getElementById("importDiv").style.display = "block";
在ie下是对的
在firefox下,布局就乱了,tr正行会缩到第一个td里面我试了多中方法都不管用
document.getElementById("importDiv").style.display=" ";
document.getElementById("importDiv").style.cssText="display:‘ ’";请指教!小弟先谢过!
<table border="1">
<tr id="importDiv" style="display: none;">
<td>123456789</td>
<td>abcdefghg</td>
</tr> <tr>
<td><a href="#" onclick="btclick();">点击</a></td>
<td></td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
function btclick()
{
var importDiv=document.getElementById("importDiv");
importDiv.style.display = "inline";
}
</script>
代码如下:
<html>
<head>
<script type="text/javascript">
function display() {
var importDiv = document.getElementById("importDiv");
importDiv.style.display = "inline";
}
function hide() {
var importDiv = document.getElementById("importDiv");
importDiv.style.display = "none";
}
</script>
</head>
<body>
<table border="1">
<tr>
<td>你好</td>
<td>hello</td>
</tr>
<tr id="importDiv" style="display: none;">
<td>123456789</td>
<td>abcdefghg</td>
</tr>
<tr>
<td>我也好</td>
<td>hi</td>
</tr>
<tr>
<td><a href="#" onclick=display();>显示</a></td>
<td><a href="#" onclick=hide();>隐藏</a></td>
</tr>
</table>
</body>
</html>
function display() {
var importDiv = document.getElementById("importDiv");
if(window.ActiveXObject)
importDiv.style.display = "block";
else
importDiv.style.display = "table-row";
}
特别是new_bird_0001
很好很强大
http://www.w3school.com.cn/css/pr_class_display.asp