Description
Pandoc's docx writer currently forces the alignment of every table cell with a w:jc
tag, even when the column alignment is AlignDefault
, in which case Pandoc emits <w:jc w:val="left" />
. Left alignment is not necessarily correct, especially because the w:jc
tag overrides the other user-controllable means to control alignment, i.e. table styles and paragraph styles. This produces a round-trip (Docx->Pandoc->Docx) failure for at least some tables. Worse, it is impossible to produce a column in which different cells have different alignments. (This is not as stupid as it sounds: center-aligned headers look good over a column that contains left-aligned paragraph text.)
Word itself generally does not emit any w:jc
tag when a cell's alignment is controlled by either the table style or paragraph style. (Well, the one file I examined had no w:jc
tags; I haven't thoroughly investigated Word's behavior.)
Proposal: Alter blockToOpenXML'
to emit no w:jc
tag when the corresponding column alignment is AlignDefault.
I haven't extensively considered how this might produce unexpected results or break existing workflows. I'm not aware of any workaround for this limitation.
See:
pandoc/src/Text/Pandoc/Writers/Docx.hs
Line 962 in 99e24cf
pandoc/src/Text/Pandoc/Writers/Docx.hs
Line 1048 in 99e24cf