在线等待:怎样让整个table居于页面正中间(上下,左右都要居中)?

怎样让整个table居于页面正中间(上下,左右都要居中)?不是table中的内容居中于table中。

1<table align="center">
2<tr>
3<td align="center">
4</td>
5</tr></table>

以上方法只能让整个table在页面中左右居中,而不能上下居中!怎样让整个table在页面中间呢?
---------------------------------------------------------------

1<body leftmargin="0" topmargin="0">
2<table border="0" cellpadding="0" cellspacing="0" height="600" width="800">
3<tr><td align="center" valign="center">
4<table bgcolor="red" border="1">
5<tr><td>hello</td></tr>
6</table>
7<td></td></td></tr>
8</table>
9</body>

---------------------------------------------------------------

lbd8848(lbd)的方法有点局限性(限制死了800x600),可以试试下面的:

 1<html>
 2<body>
 3<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
 4<tr><td align="center" valign="center" width="100%">
 5<table border="1">
 6<tr><td>Your table goes here</td></tr>
 7</table>
 8<td></td></td></tr>
 9</table>
10</body>
11</html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus