aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-03-05 13:01:23 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-03-05 13:01:23 -0800
commitf3c9d3788530e450d1bb23a4fd829bc5a6eed266 (patch)
tree410cf49e56e2b3124f161645956cc8ff8bd36cd3 /src/Text/Pandoc
parent6fda3619770f7c07ccbfc8a51614c55e01b740d8 (diff)
downloadpandoc-f3c9d3788530e450d1bb23a4fd829bc5a6eed266.tar.gz
HTML writer: Add colgroup around col tags.
Also affects EPUB writer. Closes #877.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 3ac2a836f..e0385af25 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -533,11 +533,16 @@ blockToHtml opts (Table capt aligns widths headers rows') = do
let percent w = show (truncate (100*w) :: Integer) ++ "%"
let coltags = if all (== 0.0) widths
then mempty
- else mconcat $ map (\w ->
- if writerHtml5 opts
- then H.col ! A.style (toValue $ "width: " ++ percent w)
- else H.col ! A.width (toValue $ percent w) >> nl opts)
- widths
+ else do
+ H.colgroup $ do
+ nl opts
+ mapM_ (\w -> do
+ if writerHtml5 opts
+ then H.col ! A.style (toValue $ "width: " ++
+ percent w)
+ else H.col ! A.width (toValue $ percent w)
+ nl opts) widths
+ nl opts
head' <- if all null headers
then return mempty
else do