Closed Bug 29627 Opened 25 years ago Closed 25 years ago

<TABLE ALIGN=center> ... </TABLE> centres table cell contents

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

VERIFIED DUPLICATE of bug 7112

People

(Reporter: rkl, Assigned: kmcclusk)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/4.72 [en] (X11; I; HP-UX B.11.00 9000/780; Nav) BuildID: Any current build (as of 29th Feb 2000) Mozilla appears to be centreing table cell contents when a table is surrounded by <DIV ALIGN=center>...</DIV> or <CENTER>...</CENTER>. This is the opposite behaviour to Netscape 4.72, MSIE 5.01 or Opera 3.62 (all left-align table cell contents). Reproducible: Always Steps to Reproduce: Here's some HTML code that shows up the problem: <CENTER> <TABLE> <TR><TD>Some text.<BR>Shouldn't be centred</TD></TR> </TABLE> </CENTER> You can use <DIV ALIGN=center>...</DIV> instead of <CENTER>...</CENTER> of course (BTW, why can't we have British English spellings of "center" - an English guy invented the Web after all :-) ) Actual Results: Mozilla centres the table cell contents - i.e. it is being affected by the table-wide <CENTER>...</CENTER> Expected Results: Netscape 4.72, MSIE 5.01 and Opera 3.62 all ignore the outer <CENTER>...</CENTER> and leave the table cell contents left-aligned. Looking at the W3C HTML 4.01 spec on the TABLE and DIV tags is zero help in this area - it simply doesn't specify a default table cell alignment or if <DIV ALIGN=center> (or <CENTER>) surrounding a table affects the table cell alignment. I could be wrong in all this - maybe there is something in the W3C spec that I missed. However, since NS, MSIE and Opera all show the same (different to Mozilla) behaviour, I suspect a problem with Mozilla...it could have a major impact on existing sites that use centred tables. BTW, this isn't the same bug as #18545 before you ask :-)
When I look at your example using the CENTER tag, I get exactly the same thing displayed in Gecko, Nav 4.61. and IE5. In all cases the text is left-aligned, and the table itself is centered in the window The bug says Windows 95 for the OS, but your user agent says HP-UX. I don't know why this should be different for NT than HP-UX, but reassigning to Kevin and changing OS
Assignee: troy → kmcclusk
OS: Windows 95 → HP-UX
Oops, I've changed the summary on this one - it's actually TABLE ALIGN=center that causes the problem: <TABLE ALIGN=center> <TR><TD>This bit of text<BR> should not be centred inside the table cell</TD></TR> </TABLE> The URL I gave as an example shows this up - on Mozilla the table cell contents are centred, on all other browsers, they're not (they're left-aligned). <TABLE ALIGN=center> is still a valid tag/attribute, even in HTML 4.01 but the W3C have deprecated it.
OS: HP-UX → All
Hardware: PC → All
Summary: <CENTER> ... <TABLE> ... </TABLE> ... </CENTER> centres table cell contents → <TABLE ALIGN=center> ... </TABLE> centres table cell contents
*** This bug has been marked as a duplicate of 7112 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Marking verified dup of 7112.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.