From 0706c7a285fb905345276370da17ad74eefa7135 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 3 Feb 2024 22:50:55 -0800 Subject: Docx writer: restore ability to center-justify table. The fix to #5947 caused all tables to be left indented. This was necessary to avoid extra indentation in table cells when a table appeared in a list item. This change makes the changes conditional, so that they only affect tables in list items. Closes #9393. --- src/Text/Pandoc/Writers/Docx/Table.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Docx/Table.hs b/src/Text/Pandoc/Writers/Docx/Table.hs index 08ff295c9..1e84965e9 100644 --- a/src/Text/Pandoc/Writers/Docx/Table.hs +++ b/src/Text/Pandoc/Writers/Docx/Table.hs @@ -114,8 +114,8 @@ tableToOpenXML opts blocksToOpenXML gridTable = do let tbl = mknode "w:tbl" [] ( mknode "w:tblPr" [] ( [ mknode "w:tblStyle" [("w:val","Table")] (), - mknode "w:tblW" tblWattr (), - mknode "w:jc" [("w:val","left")] () ] ++ + mknode "w:tblW" tblWattr () ] ++ + [ mknode "w:jc" [("w:val","left")] () | indent > 0 ] ++ [ mknode "w:tblInd" [("w:w", tshow indent),("w:type","dxa")] () | indent > 0 ] ++ [ mknode "w:tblLayout" [("w:type", "fixed")] () | hasWidths ] ++ -- cgit v1.2.3