@@ -1023,23 +1023,15 @@ blockToOpenXML' opts (Table _ blkCapt specs thead tbody tfoot) = do
10231023 _ -> es ++ [Elem $ mknode "w:p" [] ()]
10241024 headers' <- mapM cellToOpenXML $ zip aligns headers
10251025 rows' <- mapM (mapM cellToOpenXML . zip aligns) rows
1026− let borderProps = Elem $ mknode "w:tcPr" []
1027− [ mknode "w:tcBorders" []
1028− $ mknode "w:bottom" [("w:val","single")] ()
1029− , mknode "w:vAlign" [("w:val","bottom")] () ]
10301026 compactStyle <- pStyleM "Compact"
10311027 let emptyCell' = [Elem $ mknode "w:p" [] [mknode "w:pPr" [] [compactStyle]]]
1032− let mkcell border contents = mknode "w:tc" []
1033− $ [ borderProps | border ] ++
1034− if null contents
1035− then emptyCell'
1036− else contents
1037− let mkrow border cells =
1028+ let mkcell contents = mknode "w:tc" []
1029+ $ if null contents
1030+ then emptyCell'
1031+ else contents
1032+ let mkrow cells =
10381033 mknode "w:tr" [] $
1039− [ mknode "w:trPr" []
1040− [ mknode "w:cnfStyle" [("w:firstRow","1")] ()]
1041− | border]
1042− ++ map (mkcell border) cells
1034+ map mkcell cells
10431035 let textwidth = 7920 -- 5.5 in in twips, 1/20 pt
10441036 let fullrow = 5000 -- 100% specified in pct
10451037 let rowwidth = fullrow * sum widths
@@ -1047,6 +1039,15 @@ blockToOpenXML' opts (Table _ blkCapt specs thead tbody tfoot) = do
10471039 [("w:w", show (floor (textwidth * w) :: Integer))] ()
10481040 let hasHeader = not $ all null headers
10491041 modify $ \s -> s { stInTable = False }
1042+ -- for compatibility with Word <= 2007, we include a val with a bitmask
1043+ -- 0×0020 Apply first row conditional formatting
1044+ -- 0×0040 Apply last row conditional formatting
1045+ -- 0×0080 Apply first column conditional formatting
1046+ -- 0×0100 Apply last column conditional formatting
1047+ -- 0×0200 Do not apply row banding conditional formatting
1048+ -- 0×0400 Do not apply column banding conditional formattin
1049+ let tblLookVal :: Int
1050+ tblLookVal = if hasHeader then 0x20 else 0
10501051 return $
10511052 caption' ++
10521053 [Elem $
@@ -1059,15 +1060,17 @@ blockToOpenXML' opts (Table _ blkCapt specs thead tbody tfoot) = do
10591060 ,("w:firstColumn","0")
10601061 ,("w:lastColumn","0")
10611062 ,("w:noHBand","0")
1062− ,("w:noVBand","0")] () :
1063+ ,("w:noVBand","0")
1064+ ,("w:val", printf "%04x" tblLookVal)
1065+ ] () :
10631066 [ mknode "w:tblCaption" [("w:val", T.unpack captionStr)] ()
10641067 | not (null caption) ] )
10651068 : mknode "w:tblGrid" []
10661069 (if all (==0) widths
10671070 then []
10681071 else map mkgridcol widths)
1069− : [ mkrow True headers' | hasHeader ] ++
1070− map (mkrow False) rows'
1072+ : [ mkrow headers' | hasHeader ] ++
1073+ map mkrow rows'
10711074 )]
10721075blockToOpenXML' opts el
10731076 | BulletList lst <- el = addOpenXMLList BulletMarker lst