作者在 2009-09-15 14:40:42 发布以下内容
在<body><table></table></body>中,对table设置height="100%"不起作用,后经反复试验和询问之后,找到两个解决办法。
1,在table中设置样式CSS:
<table style="height:100%" > </table>
2,设置body的clientHeight给table
<script language="JavaScript">
function setHeight(){
var table = document.getElementById('tbl');
table.height = document.body.clientHeight;
}
</script>
<body onload='setHeight()'>
<table "85%" id='tbl' > </table>
</body>
http://blog.csdn.net/igoder/archive/2009/05/31/4227796.aspx
1,在table中设置样式CSS:
<table style="height:100%" > </table>
2,设置body的clientHeight给table
<script language="JavaScript">
function setHeight(){
var table = document.getElementById('tbl');
table.height = document.body.clientHeight;
}
</script>
<body onload='setHeight()'>
<table "85%" id='tbl' > </table>
</body>
http://blog.csdn.net/igoder/archive/2009/05/31/4227796.aspx