如何将表格与页面中间对齐 [英] How to align a table to the middle of tha page

查看:139
本文介绍了如何将表格与页面中间对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个简单的问题,但我如何调整< table>标记到页面的中心,使用css?


感谢

i know its a simple question, but how would i align a <table> tag to the center of the page, using css?

thanks

推荐答案

< table style =" width: 80%; align:center;">
<table style="width: 80%; align: center;">


或者您可以将整个表格包含在< div align =" center">< table ...>


< / table>< / div>


也是一个可行的解决方案,这可能在各种浏览器中效果更好,因为有些可能会或可能不会识别表格标签中的样式。


~nicholas
Or you could enclose the entire table in a <div align="center"><table ...>

</table></div>

is also a viable solution, this may work better in various browsers as some may or may not recognize the style in the table tag.

~nicholas


以及垂直对齐怎么样? (对于任何scrren分辨率,我希望表格在页面中心居中)
and what about vertical alignment? (for any scrren resolution I want a table to be centered in the center of the page)


这篇关于如何将表格与页面中间对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆