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

为什么不能实现表格行的高度定义?
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
</head>

<body   style= "height:100% ">
<table   width= "100% "   border= "1 "   style= "height:100% ">
    <tr>
        <td   style= "height:20px "> &nbsp; </td>
    </tr>
    <tr>
        <td   style= "height:20px "> &nbsp; </td>
    </tr>
    <tr>
        <td> &nbsp; </td>
    </tr>
</table>
</body>
</html>

这样三行距离一样,我想让上两行高度固定,不行。这是为什么啊

------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN "
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>

<body>
<table width= "100% " border= "1 ">
<tr>
<td style= "height:20px "> &nbsp; </td>
</tr>
<tr>
<td style= "height:20px "> &nbsp; </td>
</tr>
<tr>
<td> 测试 <br /> 测试 </td>
</tr>
</table>
</body>
</html>
------解决方案--------------------
<table width= "100% " height= "100% " border= "1 ">
------解决方案--------------------
<table width= "100% " border= "1 " style= "height:100% ">
<tr>
<td style= "height:20px "> &nbsp; </td>
</tr>
<tr>
<td style= "height:20px "> &nbsp; </td>
</tr>
<tr>
<td style= "height:100% "> &nbsp; </td>
</tr>
</table>