html如下:<html>
<body style="height:100%;width:100%">
<table width=100% height=100%>
<tr><td height=80px>header</td></tr>
<tr><td> <div id="container" style="height:100%;overflow:auto">container</div> </td></tr>
<tr><td height=30px>footer</td></tr>
</table>
</body>
</html>正常情况下,页面布局在IE,FireFox下都能自适应窗口大小。
但是当中间的表格container内容很多时,FireFox就不能进行overflow:auto操作,即container出现滚动条,而是表格被撑大。IE下就能正常的,container出现滚动条。
请大家帮忙,有什么解决办法。
<body style="height:100%;width:100%">
<table width=100% height=100%>
<tr><td height=80px>header</td></tr>
<tr><td> <div id="container" style="height:100%;overflow:auto">container</div> </td></tr>
<tr><td height=30px>footer</td></tr>
</table>
</body>
</html>正常情况下,页面布局在IE,FireFox下都能自适应窗口大小。
但是当中间的表格container内容很多时,FireFox就不能进行overflow:auto操作,即container出现滚动条,而是表格被撑大。IE下就能正常的,container出现滚动条。
请大家帮忙,有什么解决办法。
看看这里,可以解决你的问题
word-wrap:break-word
td{word-break: break-all; word-wrap:break-word;}
加以上CSS就行了
width firefox能正常处理.
就是height=100%;这样的高度百分比,表格内容一多,就会被撑大.IE下就能出现滚动条.有什么办法吗?
不是width的问题;word-break之类的对于width有用,对于height没用呀!!!!
<script>
function SetHeight()
{
document.getElementById("container").style.height = document.body.offsetHeight-80-30
}
</script>
<body style="height:100%;width:100%;padding:0;margin:0;border:0" onload="SetHeight()">
<table style="height:100%;width:100%;padding:0;margin:0;border:0">
<tr><td height="80px">header</td></tr>
<tr><td><div id="container" style="overflow:auto;">container,</div></td></tr>
<tr><td height=30px>footer</td></tr>
</table>
</body>
</html>