Closed Bug 276369 Opened 20 years ago Closed 20 years ago

CSS text-align Problem

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: bugzilla-2, Assigned: bugzilla)

Details

When using the CSS command "text-align" to format the BODY tag in an HTML
document with a TABLE, the command re-aligns all text within the TABLE cells
instead of the TABLE itself. This forces the coder to use deprecated tags such
as the CENTER or ALIGN tags to center or right-align a table. I've tested this
in IE and NS and it works fine in those browsers.

Example (Used curly braces instead of angle brackets to prevent code from being
interpreted as HTML in this instance):

{body style="text-align: center;"}

Title
{table}
{tr}{td colspan="2"}Text{/td}{/tr}
{tr}{td}Text{/td}{td}Text{/td}{/tr}
{/table}

{/body}

Produces in Firefox (table with incorrectly centered text):

                                          Title
|----------------------|
|        Text          |
|----------------------|
|   Text    |   Text   |
|----------------------|

Produuces in IE/NS (centered table):

                                          Title
                                 |----------------------|
                                 |Text                  |
                                 |----------------------|
                                 |Text       |Text      |
                                 |----------------------|
That's what it's supposed to do. text-align aligns text, not blocks of content
like tables.

If you want to center the table, put margin-left: auto; margin-right: auto; on
the table itself.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
Ah, I'd been doing it with the above method and previously with the {center} and
{div align} tags. The {margin} thing does what I couldn't figure out how to get
with Firefox though. Thanks.
You need to log in before you can comment on or make changes to this bug.