<table width="100%" border="1" height="100%">
<tr>
<td width="200" bgcolor="yellow" id="table_left">
<div style="width:200px">左边</div>
</td>
<td width="500" bgcolor="honeydew" id="table_center">
<span style="width:500px;height:100%">
<table id="center_Top" width="100%" height="100%">
<tr>
<td bgcolor="red" height="20">最上</td>
</tr>
<tr>
<td bgcolor="blue" height="100%">中间</td>
</tr>
<tr>
<td bgcolor="black" height="20">最下</td>
</tr>
</table>
</span>上面的放在VS2003里是可以满足我的要求的,但是如果放在VS2005里面的话就不行了,原因就是一句:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">当然大家会说删了它就可以了,但VS2005把他放出来我想自然有他的道理,
所以问一下上面的代码在有VS2005那条语句的情况下如何实现我所要的框架样式谢谢</td>
<td bgcolor="lovender" id="table_right" width="100%">右边</td>
</tr>
</table>
<tr>
<td width="200" bgcolor="yellow" id="table_left">
<div style="width:200px">左边</div>
</td>
<td width="500" bgcolor="honeydew" id="table_center">
<span style="width:500px;height:100%">
<table id="center_Top" width="100%" height="100%">
<tr>
<td bgcolor="red" height="20">最上</td>
</tr>
<tr>
<td bgcolor="blue" height="100%">中间</td>
</tr>
<tr>
<td bgcolor="black" height="20">最下</td>
</tr>
</table>
</span>上面的放在VS2003里是可以满足我的要求的,但是如果放在VS2005里面的话就不行了,原因就是一句:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">当然大家会说删了它就可以了,但VS2005把他放出来我想自然有他的道理,
所以问一下上面的代码在有VS2005那条语句的情况下如何实现我所要的框架样式谢谢</td>
<td bgcolor="lovender" id="table_right" width="100%">右边</td>
</tr>
</table>
html,body,form
{
height:100%;
}
</style>
</head>
<form id="form1" runat="server" enableviewstate="false">
<table width="100%" border="1" height="100%">
<tr>
<td width="200" bgcolor="yellow" id="table_left">
<div style="width:200px">左边</div>
</td>
<td width="500" height="100%" bgcolor="honeydew" id="table_center">
<table id="center_Top" width="100%" height="100%">
<tr>
<td bgcolor="red" height="20">最上</td>
</tr>
<tr>
<td bgcolor="blue" height="100%">中间</td>
</tr>
<tr>
<td bgcolor="black" height="20">最下</td>
</tr>
</table>
</td>
<td bgcolor="lovender" id="table_right" >右边</td>
</tr>
</table>
</form>
如
<style>
html,body,form
{
height:100%;
}
</style>
这里定义了HTML,BODY,Form为100%,但并没有定义中间那个TD为100%
为什么这样的时候中间那个TD也会自动的100%:
如测试以下代码:
<table width="100%" border="1" height="100%">
<tr>
<td width="200" bgcolor="yellow" id="table_left" height="400">
<div style="width:200px">左边</div>
</td>
<td width="500" height="100%" bgcolor="honeydew" id="table_center">
<table id="center_Top" width="100%" height="100%">
<tr>
<td bgcolor="red" height="20">最上</td>
</tr>
<tr>
<td bgcolor="blue" height="100%">中间</td>
</tr>
<tr>
<td bgcolor="black" height="20">最下</td>
</tr>
</table>
</td>
<td bgcolor="lovender" id="table_right" >右边</td>
</tr>
</table>
这里中间的TD就不会100%
但添加了
<style>
html,body,form
{
height:100%;
}
</style>
就会100%;但上面中的html,body,form并没有给这个TD进行定义啊
发错 地方了...楼主 这个可以看看http://download.csdn.net/source/159777
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<style type="text/css">
body{ width:100%;height:100%;}
#wrap{ width:100%; height:100%;}
#column{ float:left; width:60%; height:100%; }
#column1{ float:left; width:30%; height:100%; background-color:red}
#column2{ float:right; width:30%; height:100%; background-color:green}
#column3{ float:right; width:40%; height:100%; background-color:blue}
.clear{ clear:both;}
</style>
</head>
<body>
<div id="warp">
<div id="column">
<div id="column1">
这里是第一列</div>
<div id="column2">
这里是第二列</div>
<div class="clear">
</div>
</div>
<div id="column3">
这里是第三列</div>
<div class="clear">
</div>
</div>
<form id="form1" runat="server">
</form>
</body>
</html>