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

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