Include row width in table rows.
Added a property to all table rows where the sum of column widths is specified in pct (fraction of 5000).
This commit is contained in:
parent
cb4ae6112e
commit
9f3c34841b
1 changed files with 3 additions and 0 deletions
|
@ -596,12 +596,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
|
||||
let rowwidth = sum $ map (fullrow *) 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" []
|
||||
|
|
Loading…
Add table
Reference in a new issue