diff options
author | defanor <defanor@uberspace.net> | 2017-11-21 12:14:57 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-11-21 12:39:01 +0300 |
commit | bda6ff90cf20db909999e699e1edda76cbd4e8b4 (patch) | |
tree | 5b2d81bdc9a5551471f2886056f1d536cf114a04 /Pancake/Rendering.hs | |
parent | 6e76e630cf28d46d3f118687c6d5ba959b12de28 (diff) |
Adjust table column widths more evenly
Diffstat (limited to 'Pancake/Rendering.hs')
-rw-r--r-- | Pancake/Rendering.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Pancake/Rendering.hs b/Pancake/Rendering.hs index 075fef0..7e96e72 100644 --- a/Pancake/Rendering.hs +++ b/Pancake/Rendering.hs @@ -392,7 +392,8 @@ renderBlock (P.Table caption aligns widths headers rows) = do ws <- if widthsAreSet then pure widths else do lens <- map sum . transpose <$> mapM (mapM (fmap (length . unstyled . concat . rLines) . renderCell 80)) rows - pure $ map (\l -> fromIntegral l / fromIntegral (sum lens)) lens + pure $ map (\l -> fromIntegral l / fromIntegral (sum lens) * 0.7 + + 1 / fromIntegral (length lens) * 0.3) lens mapM_ (\r -> renderBlock P.HorizontalRule >> tableRow ws r) (headers : rows) renderBlock P.HorizontalRule where |