Uploaded image for project: 'CKEditor Integration'
  1. CKEditor Integration
  2. CKEDITOR-73

CKEditor is not center-aligning table that's copied from a Word file where it is center-aligned

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.12
    • Labels:
      None
    • Similar issues:

      Description

      See the attached word-file. It's a copy-paste of 'Apollo-11' article from Wikipedia.

      There's a center-aligned table. When you copy-paste it in the CKEditor, the table displays as center-aligned in the WYSIWYG editor, which is great!

      But as soon as you save the page or preview, it gets left aligned.

      Looking a bit closer, the styles of the table when displayed in WYSIWYG mode and when in save/preview mode appear slightly different, which seems unexpected. In WYSIWYG mode, there's an attribute 'align:center' applied on the table element. In Save/Preview mode, that attribute is no longer displayed but got replaced with 'text-align:center' within the style tag.

      The problem also is that there appears to be no other way to center-align the table, so the user is kind of stuck in WYSIWYG mode. If you know of a short-term fix to make the table center-align, then that'll be great so we can tell our other users about it.

      I also tried this syntax as prescribed in the XWiki Syntax guide (http://lod.springer.com/wiki/bin/view/XWiki/XWikiSyntax) but that did not center-align the table:

      (% style="background-color:red;align=centerl;width:25%" %)
      |=Title 1|=(% style="background-color:yellow" %)Title 2
      |Word 1|Word 2
      

        Attachments

        1. add table.png
          add table.png
          87 kB
        2. CKEditorTableCenter.jpg
          CKEditorTableCenter.jpg
          17 kB
        3. edit_mode.png
          edit_mode.png
          68 kB
        4. view_mode.png
          view_mode.png
          101 kB
        5. Wiki UAT Word Exercise-4.docx
          19 kB

          Issue Links

            Activity

              People

              • Assignee:
                mflorea Marius Dumitru Florea
                Reporter:
                chkumar Chetan Kumar
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: