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 Toby Inkster on 11/19/05 11:34

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:

<table style="margin:auto;width:70%">

but doesn't work in IE 5.x. 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">


--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

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

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