将一个表格横向浏览器居中 [英] To center a table crossbrowser

查看:59
本文介绍了将一个表格横向浏览器居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧

我想把桌子放在十字架上,因此我写道:

< sryle>

table { width:80%; margin-left:auto; margin-right:auto;}

< / style>

firefox工作正常,但MSIE将保证金设置为零

提前感谢

Hi at all
I''ld like to center a table crossbrowser therefore I wrote:
<sryle>
table {width:80%;margin-left:auto;margin-right:auto;}
</style>
firefox work fine but MSIE set the margin to zero
Thank in advance

推荐答案

5月31日上午10:56,Pablo < p ... @nospam.comwrote:
On May 31, 10:56 am, "Pablo" <p...@nospam.comwrote:

我想把桌子放在一个十字架的中心

firefox工作正常,但是MSIE将保证金设置为零
I''ld like to center a table crossbrowser
firefox work fine but MSIE set the margin to zero

http:// dorward.me.uk/www/centre/#ie


-

David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/

http://dorward.me.uk/www/centre/#ie

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/


Scripsit Pablo:
Scripsit Pablo:

我想把桌子放在十字架上,因此我写道:

< sryle>

table {width:80%; margin-left:auto; margin-right:auto;}

< / style>
I''ld like to center a table crossbrowser therefore I wrote:
<sryle>
table {width:80%;margin-left:auto;margin-right:auto;}
</style>



你确定吗?我敢打赌,这不是真正的标记。提示:如果在
怀疑中发布URL,你应该有疑问。

Are you sure? I bet that''s not the real markup. Hint: post the URL if in
doubt, and you should be in doubt.


firefox工作正常,但MSIE将保证金设置为零
firefox work fine but MSIE set the margin to zero



您使用了错误的HTML(没有doctype或格式错误的doctype),在Quirks模式下投入MSIE

。这_also_意味着如果你只是添加一个正确的

doctype,其他错误可能会使你的页面崩溃;请参阅
http://www.cs。 tut.fi/~jkorpela/quirks-mode.html


但在这种情况下,你可以简单地将margin-left和margin-right设置为10%,

避免这个问题。


此外,< table align =" center"自Netscape 2和IE 2以来一直有效。

为什么人们会在避免这种简单的表现形式上花费很大的精力,否则会出现因为患有神经炎,像素炎,b $ b hidelinkitis以及所有其他类型的可怕疾病的页面?


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/

You used incorrect HTML (no doctype or malformed doctype), throwing MSIE
deep into Quirks Mode. This _also_ means that if you simply add a correct
doctype, other errors may well make your page crumble down; see
http://www.cs.tut.fi/~jkorpela/quirks-mode.html

But in this case, you can simply set margin-left and margin-right to 10%,
avoiding the issue.

Besides, <table align="center"has worked ever since Netscape 2 and IE 2.
Why do people take great pains in avoiding such simple presentational
markup, on pages that otherwise suffer from divitis, pixelitis,
hidelinkitis, and all other sorts of horrendeous diseases?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

< br>

文章< Qt ******************** @ reader1.news.saunalahti.fi>,

Jukka K.Korpela < jk ****** @ cs.tut.fiwrote:
In article <Qt********************@reader1.news.saunalahti.fi >,
"Jukka K. Korpela" <jk******@cs.tut.fiwrote:

Scripsit Pablo:
Scripsit Pablo:

我想把桌子放在十字架上,因此我写道:

< sryle>

table {width:80%; margin-left:auto; margin-右:auto;}

< / style>
I''ld like to center a table crossbrowser therefore I wrote:
<sryle>
table {width:80%;margin-left:auto;margin-right:auto;}
</style>



[snip]

[snip]


此外,< table align =" center"自从Netscape 2和IE 2开始以来一直有效。

为什么人们会在避免这种简单的表现性的b $ b标记上花费大量精力,否则会出现因为患有神经炎,像素炎,< br $> b $ b hidelinkitis,以及所有其他类型的horrendeous疾病?
Besides, <table align="center"has worked ever since Netscape 2 and IE 2.
Why do people take great pains in avoiding such simple presentational
markup, on pages that otherwise suffer from divitis, pixelitis,
hidelinkitis, and all other sorts of horrendeous diseases?



我很好奇为什么你会推荐一个弃用的属性?


我不记得了如果OP有一些特定的doctype或html / css版本

,但鉴于新闻组,我有点惊讶。我是什么?缺少

I''m curious as to why you would be recommending a deprecated attribute?

I don''t remember if the OP had some specific doctype or html/css version
in mind, but given the newsgroup I''m a little surprised. What am I
missing?


这篇关于将一个表格横向浏览器居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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