aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Txt2Tags.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/Txt2Tags.hs')
-rw-r--r--src/Text/Pandoc/Readers/Txt2Tags.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
index 68ba6dd7a..c5c87e471 100644
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -267,9 +267,13 @@ table = try $ do
let size = maximum (map length rows')
let rowsPadded = map (pad size) rows'
let headerPadded = if null tableHeader then mempty else pad size tableHeader
- return $ B.table mempty
- (zip aligns (replicate ncolumns 0.0))
- headerPadded rowsPadded
+ let toRow = Row nullAttr . map B.simpleCell
+ toHeaderRow l = if null l then [] else [toRow l]
+ return $ B.table B.emptyCaption
+ (zip aligns (replicate ncolumns ColWidthDefault))
+ (TableHead nullAttr $ toHeaderRow headerPadded)
+ [TableBody nullAttr 0 [] $ map toRow rowsPadded]
+ (TableFoot nullAttr [])
pad :: (Monoid a) => Int -> [a] -> [a]
pad n xs = xs ++ replicate (n - length xs) mempty