日期:2014-05-17  浏览次数:20620 次

新手提问,怎么设HTML里面表格高度为100% ,即自适应浏览器高度
如题

------解决方案--------------------
<body style= "height:100%; width:100%; margin:0px; ">
<table width= "100% " height= "100% " border= "1 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> &nbsp; </td>
<td> &nbsp; </td>
</tr>
<tr>
<td> &nbsp; </td>
<td> &nbsp; </td>
</tr>
</table>
</body>

------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN "
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> test </title>
</head>
<body>
<body style= "height:100%; margin:0; ">
<table width= "100% " height= "100% " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td height= "100% ">
<table width= "100% " height= "100% " border= "1 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> test </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</body>
</html>