@@ -673,15 +673,14 @@ pandocTable opts headless aligns widths rawHeaders rawRows = do
673673 let minNumChars = (+ 2) . maximum . map minOffset
674674 let columns = transpose (rawHeaders : rawRows)
675675 -- minimal column width without wrapping a single word
676− let noWordWrapWidth
677− | writerWrapText opts == WrapAuto
678− = fromIntegral $ maximum (map minNumChars columns)
679− | otherwise = fromIntegral $ maximum (map numChars columns)
680− let relWidth w = floor $ max (fromIntegral (writerColumns opts) * w)
681− (noWordWrapWidth * w / minimum widths)
676+ let relWidth w col =
677+ max (floor $ fromIntegral (writerColumns opts) * w)
678+ (if writerWrapText opts == WrapAuto
679+ then minNumChars col
680+ else numChars col)
682681 let widthsInChars
683682 | isSimple = map numChars columns
684− | otherwise = map relWidth widths
683+ | otherwise = zipWith relWidth widths columns
685684 let makeRow = hcat . intersperse (lblock 1 (text " ")) .
686685 (zipWith3 alignHeader aligns widthsInChars)
687686 let rows' = map makeRow rawRows
@@ -698,9 +697,9 @@ pandocTable opts headless aligns widths rawHeaders rawRows = do
698697 let head'' = if headless
699698 then empty
700699 else border <> cr <> head'
701− let body = if maxRowHeight > 1
702− then vsep rows'
703− else vcat rows'
700+ let body = if isSimple
701+ then vcat rows'
702+ else vsep rows'
704703 let bottom = if headless
705704 then underline
706705 else border