Closed Bug 23116 Opened 25 years ago Closed 24 years ago

CSS "text-align: center;" Does not center inline-table as it should

Categories

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

x86
Windows 98
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: NathanJM, Assigned: karnaze)

References

()

Details

Attachments

(2 files)

Using CSS, Mozilla M13 (1/3/00 release) does not center table when using
"text-align: center;".  According to the CSS recomendation from the W3C, this
should center all block-level elements, which includes tables.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
No, that's not what the CSS spec says. From 16.2 of the CSS2 spec:

"This property describes how inline content of a block is aligned. Values have
the following meanings: ..."

and later on:

"A block of text is a stack of line boxes. In the case of 'left', 'right' and
'center', this property specifies how the inline boxes within each line box
align with respect to the line box's left and right sides; alignment is not with
respect to the viewport."

That says that the inline boxes themselves should be aligned and not the
block-level element.

The "margin-left" and "margin-right" properties both set to "auto" would cause
the block-level element to be centered

Cc'ing David Baron to confirm.
Agreed.  However, Chris Karnaze has an open bug on possibly changing some of
this for compatibility mode.  Kipp worked on this a long time ago, but it still
isn't quite right.  See bug 7112.
Status: RESOLVED → VERIFIED
Marking verified per last comments.
Status: VERIFIED → REOPENED
Sorry, i failed to mention it was setup as an inline table.

From the CSS2 spec:
http://www.w3.org/TR/REC-CSS2/

17.2 The CSS table model
...
inline-table (In
HTML: TABLE) Specifies that an element defines an inline-level table: it is a
rectangular block that participates in an inline formatting context).
...

9.4.2
Inline formatting context
...
When the total width of the inline boxes on a line
is less than the width of the line box containing them, their horizontal
distribution within the line box is determined by the 'text-align' property. If
that property has the value 'justify', the user agent may stretch the inline
boxes as well.


--Nathan
Mozilla doesn't support inline-table yet.  See bug 18217.  (Perhaps the symptoms
of that bug have changed.)

Could you attach your test case?
Were you using 'text-align: center' on the inline-table itself (bug still
invalid) or on its container (valid, if inline-table works)?
text-align: center;  was used on the container (DIV)
Assignee: troy → karnaze
Status: REOPENED → NEW
Component: Layout → HTMLTables
Resolution: INVALID → ---
Okay, well I'll change the component to HTML Tables and then re-assign it to
Chris.

Once we do support inline tables we can revisit this issue
Summary: CSS "text-align: center;" Does not center table as it should → CSS "text-align: center;" Does not center inline-table as it should
Status: NEW → ASSIGNED
Target Milestone: M17
Status: ASSIGNED → RESOLVED
Closed: 25 years ago24 years ago
Resolution: --- → WORKSFORME
I think that display:inline-table is being mapped to display:table currently 
which might help explain why the url looks ok to me. There may already be a bug 
open on inline tables, but I don't think this bug's test case catches the real 
bug with inline tables.
There either is or should be a bug open on text-align: center centering tables. 
So when that's fixed, this'll have to be reopened.
But then again, this bug is really an RFE that inline-table should be
implemented...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: