You are here: Re: How's this for cross-browser table positioning? « HTML « IT news, forums, messages
Re: How's this for cross-browser table positioning?

Posted by Curtis on 11/19/82 11:34

Toby Inkster <usenet200512@tobyinkster.co.uk> wrote in
message news:pab173-s1o.ln1@ophelia.g5n.co.uk...
> Curtis wrote:
>
> > <table style="margin-left: 15%; margin-right: 15%;
width:
> > 70%;">
> > Any reason why we shouldn't stick with this syntax?
>
> Nope. Margins are the correct way to centre a block-level
element. You can
> abbreviate your example like this:
>
> <table style="margin:0 15%;width:70%">
> The following should also be equivalent:

I'm afraid you lost me, Toby. You said no, then said margins
were the correct way.

>
> <table style="margin:auto;width:70%">
> but doesn't work in IE 5.x.

The whole point was the cross-browser compatibility, though.
Our website gets a lot of hits from IE 5.X users.

> It only saves one byte though, so margin:auto
> probably isn't much use in this example -- it does however
become useful
> when you don't know the percentage width of the table.
e.g.
>
> <table style="margin:auto;width:15em">

Margin auto works great for Firefox and Opera, but fails for
IE 5--I haven't tested on 6 yet, but no matter. If it fails
on 5, we won't use it.

---

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация