Opened 16 years ago

Closed 16 years ago

#3762 closed Bug (wontfix)

Table alignment use of align attribute

Reported by: Damian Owned by: Tobiasz Cudnik
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: IBM Confirmed Cc:

Description

The table plugin uses the align attribute to align a table horizontally on the page. Unfortunately in some browsers (e.g. FF) this setting is overridden if CSS margins are set on the table. This is especially problematic when "center" alignment is desired.

The align attribute is also deprecated. So, a better way to set the alignment of the editor should be used.

Change History (3)

comment:1 Changed 16 years ago by Tobiasz Cudnik

Keywords: Confirmed added
Owner: set to Tobiasz Cudnik
Status: newassigned

comment:2 Changed 16 years ago by Tobiasz Cudnik

Horizontal alignment relays on margins of centered element, so even when we change table[align=center] to more proper way which is

div[style="text-align: center"] > table[style="margins: auto"]

Then changing table's margins will also destroy the effect. Although if we will set margin values as inline, they wont be possible to change using stylesheets, which may be the point.

comment:3 Changed 16 years ago by Frederico Caldeira Knabben

Resolution: wontfix
Status: assignedclosed

The things to consider here is that we should use the only the <table> element to perform the alignment. We should not rely on other elements to achieve it (the outer div), because it's most likely that the user will be able to include other content inside that div, having undesired results. Note that we're in a dynamic environment here, so the solutions used on static pages don't fit us in all cases.

The only other way to table alignment is by using <table style="margin-left:auto; margin-right:auto;">. But, it's well known that this is not compatible with all browsers.

So, we need to be practical here, sticking with the generic solution that works in all cases: the align attribute. We have been using it for years, and I can't recall any complain about it, so it looks like it's a stable solution.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy