W3C home > Mailing lists > Public > www-style@w3.org > October 1997

Re: With CSS how does one ALIGN block-level elements?

From: David Perrell <davidp@earthlink.net>
Date: Mon, 20 Oct 1997 14:00:40 -0700
To: <neil@bigpic.com>
Cc: <www-style@w3.org>
Message-ID: <01bcdd9b$38c47600$b111d9cf@davidp>
Neil St.Laurent  wrote:

--"
Is the following then the most correct way to center a table?

<TABLE STYLE="margin-left: auto; margin-right: auto">
"--

That should work in IE, seeing as how other margin declarations work on
TABLE, but it does not. CSS margins don't work on TABLE at all in NSN4.

--"
If not, then what is?
"--

In MSIE, you can declare

  TABLE { text-align: center }

but NSN doesn't support this. So, for the time being we're stuck with <TABLE
ALIGN=center>.

Defining the legacy rendering of TABLEs in terms of CSS properties is
difficult. If ALIGN is the HTML equivalent of text-align, then the fact that
this works on a TABLE in IE seems to imply that the rows and cells must be
inline elements. But if this is the case, what of BORDER? The rendering of
BORDER on a table does not correspond to the equivalent CSS property, and
declaring TABLE borders in CSS has no effect in either IE or N. Obviously,
not every TABLE attribute is going to correspond directly to a single CSS
property, and -- depending on the model -- some might apply to children
(CELLPADDING, CELLSPACING, BORDER) contrary to inheritance rules.

I believe there have been proposals for dealing with tables, but none opened
to public comment. Too bad.

David Perrell
Received on Monday, 20 October 1997 17:01:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:51 GMT