在Internet Explorer中居中 [英] Center a table in internet explorer

查看:89
本文介绍了在Internet Explorer中居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Internet Explorer 7 +中集中整个表格?



我想避免将< td> code>元素。我想用 width:auto; 将近1050个像素作为整个表格的中心。

解决方案,body元素上的> text-align:center; ;否则,通常的方式即使没有宽度,定心也可以工作保证金:0自动



添加:



这里有一个关于这个主题的回答,涵盖了怪癖和标准。 stackoverflow.com/questions/301147/css-way-to-horizo​​ntally-align-table/301164#301164\">用CSS水平对齐表格的方法


How can you center an entire table in Internet Explorer 7+?

I want to avoid on centering the <td> element. I want to center the entire table with width:auto;nearly 1050 pixels.

解决方案

text-align: center; on the body element should do it if the document is in quirks mode, otherwise the usual way of centering will also work even without a width on a table margin: 0 auto

added:

here's a link to a previous answer on the subject, covers both quirks and standards

CSS way to horizontally align table

这篇关于在Internet Explorer中居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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