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 Els on 11/19/33 11:34

Curtis wrote:

> 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.

You asked a negative: 'any reason why we *shoudn't* ...'.

>> <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.

I use both.
<div>
<table>....</table>
</div>

div{text-align:center;}
table{margin-auto;width:15em;text-align:left;}

Works cross-browser.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: The Scream - Man In The Moon ( Album Version )

 

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

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