html代码中表格居中且向下靠

如题所述

html中让表格在浏览器中左右居中,可以设置表格的align属性
align有三个属性:
        1、居中:center;
        2、靠左:left;
        3、靠右:right。

    html中是没办法实现上下居中的,如果设置上下居中,需要通过js程序来设置。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-11-08
使用align=”center“即可实现表格的居中。代码实例如下:

<html>
<meta charset="utf-8">
<body>
<table align="center" border="1">
<tr>
<td>表格内容</td>
</tr>
</table>
</body>
</html>本回答被提问者和网友采纳