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

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

From: Charles Walker <cewalker@kingston.net>
Date: Sun, 21 Apr 2002 17:52:12 -0400
To: Thanasis Kinias <tkinias@optimalco.com>
Cc: www-validator@w3.org
Message-Id: <JIFE643XPMKGON2Y1URLGA0B7YXNHHD.3cc3348c@charlie>
Good point.  I'm trying to discipline myself to use HTML Strict - but this, of course, 
would be a tempting occasion to use HTML Transitional and just add 
<table align="center">!

Charlie Walker

-------------------------------

21/04/2002 5:41:52 PM, Thanasis Kinias <tkinias@optimalco.com> wrote:

>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:52:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:03 GMT