Table: naming improvement

This commit is contained in:
Jonathan Daugherty 2021-01-31 20:56:35 -08:00
parent f91c56976d
commit e84f140a82

View File

@ -173,7 +173,7 @@ renderTable t =
byColumn = transpose cellResults byColumn = transpose cellResults
toW = Widget Fixed Fixed . return toW = Widget Fixed Fixed . return
totalHeight = sum rowHeights totalHeight = sum rowHeights
maybeAlign align width w = applyColAlignment align width w =
Widget Fixed Fixed $ do Widget Fixed Fixed $ do
result <- render w result <- render w
case align of case align of
@ -189,7 +189,7 @@ renderTable t =
AlignBottom -> vLimit rHeight $ padTop Max $ toW result AlignBottom -> vLimit rHeight $ padTop Max $ toW result
mkColumn (hAlign, width, colCells) = do mkColumn (hAlign, width, colCells) = do
let paddedCells = flip map (zip3 allRowAligns rowHeights colCells) $ \(vAlign, rHeight, cell) -> let paddedCells = flip map (zip3 allRowAligns rowHeights colCells) $ \(vAlign, rHeight, cell) ->
maybeAlign hAlign width $ applyColAlignment hAlign width $
applyRowAlignment rHeight vAlign cell applyRowAlignment rHeight vAlign cell
maybeRowBorders = if drawRowBorders t maybeRowBorders = if drawRowBorders t
then intersperse (hLimit width hBorder) then intersperse (hLimit width hBorder)