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