diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-17 12:54:38 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-17 12:54:38 -0700 |
commit | 8e60d35d5850d13ad2c70c8815b12578c0dba4e9 (patch) | |
tree | 61844813b4672bae78943f62142e7b723f8f1544 | |
parent | b6103eeb836d90591634aa1431e1a1d24296e677 (diff) | |
parent | 753e47194c9f04f72532139e6bf2e9122a1356c3 (diff) | |
download | pandoc-8e60d35d5850d13ad2c70c8815b12578c0dba4e9.tar.gz |
Merge pull request #1536 from considerate/master
Add row width to tables in Docx XML
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 2ee7bd5a5..fbf38e6f1 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -603,12 +603,15 @@ blockToOpenXML opts (Table caption aligns widths headers rows) = do else contents let mkrow border cells = mknode "w:tr" [] $ map (mkcell border) cells let textwidth = 7920 -- 5.5 in in twips, 1/20 pt + let fullrow = 5000 -- 100% specified in pct + let rowwidth = fullrow * sum widths let mkgridcol w = mknode "w:gridCol" [("w:w", show $ (floor (textwidth * w) :: Integer))] () return $ [ mknode "w:tbl" [] ( mknode "w:tblPr" [] ( [ mknode "w:tblStyle" [("w:val","TableNormal")] () ] ++ + [ mknode "w:tblW" [("w:type", "pct"), ("w:w", (show rowwidth))] () ] ++ [ mknode "w:tblCaption" [("w:val", captionStr)] () | not (null caption) ] ) : mknode "w:tblGrid" [] |