Re:Inheritance of alignment for TD

I think you're a little off target.  

>Most importantly TD should *not* inherit the ALIGN attribute from any tag outside it's own TABLE

That's not necessarily true.  From the part of the spec that you linked to, I can see why you have that impression, but you left out the all important item 6, lowest in 
precendence, that states that the cell alignment may be "The default attribute value".  Another part of the spec, 
http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.3.4 , states that for an attribute defined as having a default value that is "#IMPLIED" (e.g. align 
attribute of TD), "the default value must be supplied by the user agent (in some cases via inheritance from parent elements)".  So 
the default attribute value can come from a "parent" element.  I wonder if they really mean parent element.  If that were the case, 
the inheritance for a TD would stop at the enclosing TR and could never include the enclosing TABLE, so I'm assuming what they 
really mean is ancestor.  So, if W3 really means "ancestor" element, the TD can inherit the value of the align attribute from an 
element enclosing it's "own" table.

>Instead if none of the above applies it should use the default alignment which is LEFT.

Once again referring to the section linked to above, when the default attribute value is "#IMPLIED", that means the user agent 
must supply *a* default value.  A particular browser may by convention have provided "left" for TD elements, but it could be any 
appropriate value.  It's worth noting that the sample style sheet for HTML 4.0 in the CSS 2 spec does not define any alignment 
for TD elements.

>In the examples found at the adress below, the red table-cells should be aligned to the left. Is that correct?

Not necessarily.  According to the spec, in your document it is up to the user agent to decide the alignment for those cells.  It 
could either use the value of a "parent" element, such as the enclosing TD in your "A table within a centered table cell in another 
table", or the enclosing DIV in your "A table within a center-aligned div-tag", or provide a value of it's choosing.  The spec does 
say "However, user agents should substitute the default attribute for the current directionality (i.e., not just "left" in all cases)", but 
that seems to be a suggestion.  I would really like to know if the W3 means "parent" or "ancestor" in 3.3.4 Attribute declarations.

Received on Friday, 19 October 2001 10:08:46 UTC