Ticket #3762 (closed Bug: wontfix)

Opened 6 years ago

Last modified 6 years ago

Table alignment use of align attribute

Reported by: damo 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

comment:1 Changed 6 years ago by tobiasz.cudnik

  • Keywords Confirmed added
  • Status changed from new to assigned
  • Owner set to tobiasz.cudnik

comment:2 Changed 6 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 6 years ago by fredck

  • Status changed from assigned to closed
  • Resolution set to wontfix

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 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy