W3C home > Mailing lists > Public > www-validator@w3.org > April 2002

Re: Centring Tables in HTML 4.01 Strict...?

From: Thanasis Kinias <tkinias@optimalco.com>
Date: Sun, 21 Apr 2002 14:41:52 -0700
To: Charles Walker <cewalker@kingston.net>
Cc: kynn@idyllmtn.com, www-validator@w3.org
Message-ID: <20020421144152.A556@glaux.ph.cox.net>
scripsit Charles Walker:
> Perfect.  Works like a charm!  I also retained the original body declaration, 
> without which the non-compliant browsers won't center-align the table. 
> Is this okay as a work-around?
> body { text-align:center; } 
> table { margin-left: auto; margin-right: auto; }

There's nothing wrong with doing `text-align: center' on <body>, but
that should be inherited by all the descendants of <body>.  I.e., the
text contents of your <p>, <td>, etc. elements should in this case be
rendered centered instead of left-aligned or justified.  You'll need to
override that if such isn't the desired effect, by setting `text-align:
left' or `text-align: justify' as appropriate on the relevant elements.

Thanasis Kinias
Web Developer, Information Technology
Graduate Student, Department of History
Arizona State University
Tempe, Arizona, U.S.A.

Ash nazg durbatulūk, ash nazg gimbatul,
Ash nazg thrakatulūk agh burzum-ishi krimpatul
Received on Sunday, 21 April 2002 17:42:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:33 UTC