Closed Bug 18401 Opened 25 years ago Closed 25 years ago

TD elements not inheriting %cellhalign from TR elements

Categories

(Core :: Layout: Tables, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED DUPLICATE of bug 1802

People

(Reporter: sidr, Assigned: karnaze)

References

()

Details

(Whiteboard: [testcase])

Attachments

(1 file)

Summary:
The %cellhalign attribute, defined by the TR section of the HTML spec
<URL:http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.2.5> as
applying to <TR> elements as well as <TD> and <TH> elements, is having no effect
on horizontal alignment within <TD> cells enclosed in a <TR>. The comment
for this attribute of the <TH> element "-- horizontal alignment in cells --"
strongly implies that it is meant to apply to <TD> and <TH> cell contents,
but more importantly, the sum of the widths of the cells in a row is always
equal to the width of the row, so alignment applied to <TH> cannot apply
to <TD> and <TR> cells, so, by elimination, it must apply to the contents
of those elements.

Mozilla is incorrectly left-aligning the contents of all <TD> cells when
that cell has no horizontal alignment specified, when the <TR> that <TD>
is enclosed by does have a different horizontal alignment specified.
This shows up strikingly on the U.S. Government Printing Office's webpage
for viewing, downloading, or ordering the "Findings of Fact" prepared by
Judge Jackson for the U.S. v. Microsoft Antitrust case
<URL:http://usvms.gpo.gov/>

Reduced testcase following immediately showing how Mozilla is getting this
wrong whether the horizontal alignment is specified by HTML attributes or
CSS properties, but getting it right outside of tables.

Here are the relevant DTD snippets for <TR> and %cellhalign.

<!ELEMENT TR       - O (TH|TD)+        -- table row -->
 <!ATTLIST TR                           -- table row --
   %attrs;                              -- %coreattrs, %i18n, %events --
   %cellhalign;                         -- horizontal alignment in cells --
   %cellvalign;                         -- vertical alignment in cells --
   >

<!ENTITY % cellhalign
   "align      (left|center|right|justify|char) #IMPLIED
    char       %Character;    #IMPLIED  -- alignment char, e.g. char=':' --
    charoff    %Length;       #IMPLIED  -- offset for alignment char --"
   >

(This would get really annoying if the "char" attribute were also used
in a financial info table where all but one cell pe row was aligned on ".")

Steps to reproduce:
View the URL above or the teatcase.

Actual Results:
The contents of <TD> cells are always left-aligned unless otherwise
specified for that cell, regardless of the horizontal alignment specified
for the parent <TR> element.

Expected Results:
The horizontal alignment of the contents of <TD> cells is always the same as
that specified for the parent <TR> element unless otherwise specified for
that cell.

Does not work correctly with:
1999-11-08-09-M11 nightly binary on Windows NT

Work correctly with:
IE5 on Windows NT
NN 4.7 on Windows NT (for ALIGN attribute but not CSS text-align property)
Whiteboard: [testcase]
Oops. Obviously I meant <TR>, not <TH> in the first line of
<< The comment
for this attribute of the <TH> element "-- horizontal alignment in cells --"
strongly implies that it is meant to apply to <TD> and <TH> cell contents >>

Testcase added.
Summary: TD elements not inheriting %cellhalign from TH elements → TD elements not inheriting %cellhalign from TR elements
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
*** This bug has been marked as a duplicate of 1802 ***
Status: RESOLVED → VERIFIED
Verifying bug dup of #1802
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: