Closed Bug 111325 Opened 23 years ago Closed 23 years ago

mozilla does not center tables when only using style sheets (text-align: center). it does using align="center", which is invalin in HTML4.01/strict

Categories

(Core :: Layout, defect)

x86
Windows NT
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 49274

People

(Reporter: Daniel.Steinberger, Assigned: attinasi)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6) Gecko/20011120
BuildID:    2001112009

mozilla does not center but left-justify tables when only using style sheets via
<div class="middle"> with table.middle { text-align: center }. Mozilla does
center tables, when i'm using <div align="center"> tags, which is invalin in
HTML4.01/strict. This behavior also appears in nested tables, when the nested
table should be centered.

I created a demonstration here:
http://frozenfire.dnsalias.net/NEMESiS/moz-testcase.html

note: the same bahavior with 0.9.5

Reproducible: Always
Steps to Reproduce:
1. load the testpage or every other html-document centering tables with CSS {
text-align: center } command

Actual Results:  tables get justified on the left

Expected Results:  tables should be centered
"text-align: center" centers _text_.  Hence the name.  A table is not text, it
is a block.

To center the table, set "margin-left: auto; margin-right: auto" on the table in
CSS.

Duplicate of "'text-align:center;' doesn't center table"

*** This bug has been marked as a duplicate of 49274 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
well yes, it's not thant i'm stupod. i thought about this name already, before
posting this bug. and i also read the RFC and that there should be the
possibility to center it the way you suggested. so i already tried div.middle {
margin-left: auto; margin-right: auto } already. and to make you happy and see
for your self, it does simply not work, i just changes the div.middle in another
testcase!
please take a look at http://frozenfire.dnsalias.net/NEMESiS/moz-testcase2.html
and reconsider, because it still doesn't get centered!
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---

*** This bug has been marked as a duplicate of 49274 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → DUPLICATE
v.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.