Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Text.Layout.Table.Vertical
Description
This module provides functions for vertical alginment of columns.
Vertical padding of columns
vPad :: a -> [Position V] -> [Col a] -> [Col a] Source #
Fill all columns to the same length by aligning at the given positions.
vPadAll :: a -> Position V -> [Col a] -> [Col a] Source #
Fill all columns to the same length by aligning at the given position.
Converting columns to rows with positioning
colsAsRowsAll :: Position V -> [Col a] -> [Row (Maybe a)] Source #
Merges multiple columns together to a valid grid without holes. For example:
>>>
colsAsRowsAll top [justifyText 10 "This text will not fit on one line.", ["42", "23"]]
[[Just "This text",Just "42"],[Just "will not",Just "23"],[Just "fit on one",Nothing],[Just "line.",Nothing]]
The result is intended to be used with a grid layout function like grid
.
colsAsRows :: [Position V] -> [Col a] -> [Row (Maybe a)] Source #
Works like colsAsRowsAll
but every position can be specified on its
own:
>>>
colsAsRows [top, center, bottom] [["a1"], ["b1", "b2", "b3"], ["c3"]]
[[Just "a1",Just "b1",Nothing],[Nothing,Just "b2",Nothing],[Nothing,Just "b3",Just "c3"]]