text-align:center and tables

VERIFIED FIXED in M16

Status

()

Core
CSS Parsing and Computation
P3
normal
VERIFIED FIXED
18 years ago
15 years ago

People

(Reporter: ekrock's old account (dead), Assigned: buster)

Tracking

({css1})

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

18 years ago
[ I'm forwarding this CSS bug report by armin.birrer@gmx.net from 
netscape.beta.feedback.pagelayout for analysis. The reporter's not registered 
in Bugzilla.]

Operating System: Windows 95
Language: English
Issue Summary: CSS:div.center{text-align:center;} does not work
Component: Page Layout
Doing What: Browing web pages
Severity: Something didn't work right
Can Reproduce: Yes, Always
Try this URL: http://
Issue Detail: center tag does not work correctly
**********************************
Using the center tag in CSS Class, it does not work

CSS-File:
*********
div.center { text-align:center; }

HTML-File:
**********
<div class="center">
Sample Text
</div>


Comment:
********
This works properly in Netscape 4.72 (also Opera 3.62 and IE 5.0)
But NOT in the new Netscape 6 Pre-Release 1 English
Build 6.0.15-nb1b.2000033112

Email Address: armin.birrer@gmx.net

Comment 1

18 years ago
Created attachment 7642 [details]
One-file testcase for div.center { text-align:center; }

Comment 2

18 years ago
Hmm, the one-file testcase works fine using the latest M16 build, an M15 build
from 2000-04-06, and the M14 release build. Could this only be a problem when
the CSS is in a seperate file?
(Reporter)

Comment 3

18 years ago
Sounds like it as the reporter seems to have been using separate files.

Comment 4

18 years ago
Created attachment 7666 [details]
table centred with "div.center { text-align:center; }"

Comment 5

18 years ago
The bug only appears if the CSS TAG "div.center { text-align:center; }" is used 
to centre a table. It doesn't matter whether the CSS is in a seperate file or 
not.

Comment 6

18 years ago
Confirming this on Linux build 2000.04.16.06.  text-align: center, according to
the CSS2 spec, should center inline content of the DIV.  Maybe a TABLE isn't
inline content?  However, changing the TABLE to <TABLE style="display:
inline-table">, which presumably makes it into inline content, also doesn't make
the table centered.

Comment 7

18 years ago
CC to reporter; changing summary.
Summary: div.center { text-align:center; } fails on PR1 → text-align:center doesn't center table
Mozilla doesn't support inline-table.  text-align should not center blocks. 
However, it might do so in quirks mode (I think actually buster changed it to do
it in all cases, which is wrong...).

Comment 9

18 years ago
this looks like a dup of bug 23116.

am i missing a subtle difference here?

Comment 10

18 years ago
Well, on yesterday's build text-align: center makes tables centered even in
strict mode.  I'll reassign this to buster as per dbaron's comments.  To
summarize what this bug is about: text-align: center should not (as per spec)
center a table in strict mode (it does right now).  Should it center tables in
compatibility mode?
Assignee: pierre → buster
Summary: text-align:center doesn't center table → text-align:center and tables

Comment 11

18 years ago
Created attachment 7776 [details]
testcase strict mode

Comment 12

18 years ago
Created attachment 7777 [details]
testcase compatibility mode
Keywords: css1
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → M16
Compatibility mode detection is broken now. See bug 36872.
But even if using the viewer, table with 'text-align: center' is centerd. It 
should not be centered per spec.
Depends on: 36872
(Assignee)

Updated

18 years ago
Whiteboard: fix in hand
Bug 36872 is fixed, but table is still centered.
(Assignee)

Comment 15

18 years ago
fixed.  compatibility mode still centers the table, but strict mode does not
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Whiteboard: fix in hand

Comment 16

17 years ago
Using the following builds:

Windows: 08_09_09_m18
Mac: 08_08_20_m18
Linux: 08_10_08_m18

reopening bug. Using the testcases provided, 'strict' mode correctly DOES NOT 
center top table. However, in 'transitional' or 'quirk' mode, the beahvior is 
the same - top table is not centered. I understood from this bug that in 'quirk' 
mode 'text-align: center' should center the block as well as the text. 
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I actually changed this back when I fixed some other centering bugs.  Nav4's
behavior was incorrect according to the CSS spec.  If you can point to more than
one or two real sites that depend on that behavior I'm willing to change it back
for quirks mode, but otherwise I think this bug should be resolved as INVALID. 
I don't think there's a need to copy Nav4's bugs just because one person filed
abug saying they should be copied.

I think very few sites use the CSS 'text-align: center' for centering tables
because HTML's CENTER element or <DIV ALIGN=CENTER> or <TABLE ALIGN=CENTER> are
more reliable across browsers than CSS.
(Assignee)

Comment 18

17 years ago
I agree with David's last comment.  Our quirks mode is intended to replicate
existing Nav4 behavior in HTML markup (and sometimes IE behavior where Nav is
just completely broken).  It is absolutely not intended to mimic legacy behavior
for CSS.  So it's the right decision to make <CENTER> behavior like Nav4 in
quirks mode, because it's a common idiom.  But it doesn't make much sense to
intentionally break CSS in quirks mode for an idiom that isn't in common usage.

I'm marking this bug Fixed again, to indicate that the portion of the bug report
that ought to be fixed has been fixed.
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago17 years ago
Resolution: --- → FIXED
Netscape's standard compliance QA team reorganised itself once again, so taking 
remaining non-tables style bugs. Sorry about the spam. I tried to get this done 
directly at the database level, but apparently that is "not easy because of the 
shadow db", "plus it screws up the audit trail", so no can do...
QA Contact: chrisd → ian
QA Contact: ian → amar

Comment 20

15 years ago
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.