﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
16811	No table align when pasted from Word	Marek Lewandowski	Marek Lewandowski	"== Steps to reproduce ==

1. Open attached `Table_alignment.docx` document in Word.
2. Copy it's content.
3. Paste into a full featured editor.

== Expected result ==

Tables are aligned as in the docx document.

== Actual result ==

Alignments are stripped.

== More details ==

It looks in Word pretty much like this:

[[Image(https://i.imgur.com/OdLhLi5.png)]]

The problem is that Word generates following markup:

{{{
<div align=right>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='(...)'>
 <tr style='(...)'>
 	(...)
 </tr>
</table>

</div>
}}}

Which displays it correctly, but uses deprecated `align` attribute.

We have a [https://github.com/ckeditor/ckeditor-dev/blob/7a3a51194875502fd00d9e4d23d5e87557d80d34/core/filter.js#L2098-L2107 style transformation] in core which transforms any `align` into `float` CSS prop, which is fine for elements like `table`, `img`, `iframe`, but it's wrong for `div` and `p`. Becasue for `div` and `p` it defines the alignment of content elements within this element.

It's also worth to remember that `align` is a little more aggresive than `text-align` CSS prop, as it affects anything, whereas for `text-align` you need to apply `margin: x auto` for block-alike elements, otherwise they won't be aligned."	Bug	closed	Nice to have (we want to work on it)	CKEditor 4.7.0	General	4.6.0	fixed		
