62,243
社区成员




<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<style type="text/css">
*{margin:0 auto;padding:0px;}
#top,#bottom{width:100%;height:100px;background:#f00;}
#middle{width:100%;height:100px;background:#0f0}
</style>
<script type="text/javascript">
function load()
{
//计算得到出上下两部分的高度
var auto_height=document.documentElement.clientHeight-200;
document.getElementById("middle").style.height=auto_height+"px";
//alert(auto_height);
}
</script>
</head>
<body onload="load();">
<table style="width:100%;border-collapse:collapse;">
<tr id="top">
<td>top</td>
</tr>
<tr id="middle">
<td>middle</td>
</tr>
<tr id="bottom">
<td>bottom</td>
</tr>
</table>
</body>
</html>
在ie6+ chremo ff测试通过