table-layout-0.8.0.5: Layout text as grid or table.

Safe HaskellSafe
LanguageHaskell2010

Text.Layout.Table.Vertical

Contents

Description

This module provides functions for vertical alginment of columns.

Synopsis

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 [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"]]
[["This  text","42"],["will   not","23"],["fit on one",""],["line.",""]]

The result is intended to be used with a grid layout function like grid.

colsAsRows :: [Position V] -> [Col [a]] -> [Row [a]] Source #

Works like colsAsRowsAll but every position can be specified on its own:

>>> colsAsRows [top, center, bottom] [["a1"], ["b1", "b2", "b3"], ["c3"]]
[["a1","b1",""],["","b2",""],["","b3","c3"]]