Re: Centring Tables in HTML 4.01 Strict...? or rather align right:

Le jeu 12/09/2002 à 09:33, Ralf Hauser a écrit :
> I tried to add to my CSS
>    table.langSel {text-align: right;}
> and to the html file
>    <table class="langSel" border=0>
> But this does not have the same effect as align right.
> my table is still at the left end of the screen, just the text in the cell
> is aligned to the right.

The CSS1 Recommendations indeed says:
"'text-align': This property describes how text is aligned within the
element."
http://www.w3.org/TR/REC-CSS1#text-align

> What do you recommend?

table.langSel { margin-right:0 ; margin-left:auto; }

[Note that strictly speaking, a table tag is used only for tabular data,
not for layout purposes].

> P.S.: Some further thoughts
> 1) http://validator.w3.org/file-upload.html tells me that
> <table align=right> is no longer valid.
> 2) The HTML spec still has it, but calls it "deprecated".

It depends on the doctype against which your document is validated.
It's not valid in the Strict Doctype, but it is in the Transitional one.


> 3) the http://www.htmlhelp.com/faq/html/tables.html#align-table still
> recommends the above syntax?

I'll contact them and suggest they update this entry. I kind of doubt
they will, though.

Hope this helps,

Dom
-- 
Dominique Hazaël-Massieux - http://www.w3.org/People/Dom/
W3C/INRIA
mailto:dom@w3.org

Received on Thursday, 12 September 2002 06:11:03 UTC