Nicky Whelan:如何让网页中的表格上下居中?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/12 04:28:24
如何让网页中的表格上下居中?我用height="100%"怎么就不管用的呢?

你试试我这个代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><!--加这句就可以height="100%"-->
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>height="100%"</title>
</head>

<body >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFF00">
<!--DWLayoutTable-->
<tr>
<td> </td>
</tr>
</table>
</body>
</html>

注意:关键就是:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

把你要居中内容的代码放进<center>你要居中内容的代码</center>中就行啦

你点页面属性,里面有个上边距,调整到150就差不多居中了!

选中整个网格点居中就行了