Simple table representation. This module is meant to be imported qualified.
- data Alignment
- = AlignLeft
- | AlignRight
- data Table a
- toList :: a -> Table a -> [[a]]
- alignments :: Table a -> IntMap Alignment
- defaultAlignment :: Alignment
- columns :: Table a -> Int
- rows :: Table a -> Int
- empty :: Table a
- fromList :: [[a]] -> Table a
- newRow :: Table a -> Table a
- setAlignment :: Int -> Alignment -> Table a -> Table a
- appendCell :: a -> Table a -> Table a
- appendNumCell :: RealFrac a => Int -> a -> Table String -> Table String
- getCell :: (Int, Int) -> Table a -> Maybe a
- setCell :: (Int, Int) -> a -> Table a -> Table a
- headerLastCell :: a -> Table a -> Table a
- alignLastCell :: Alignment -> Table a -> Table a
- toLaTeX :: (a -> String) -> Table a -> String
Datatypes
A column alignment.
A table with aligned rows.
Queries
alignments :: Table a -> IntMap AlignmentSource
The alignment for each column
defaultAlignment :: AlignmentSource
The default alignment to be used for a row.
Construction/Modification
appendCell :: a -> Table a -> Table aSource
Append a cell at the end of the last row
Append a cell containing a number; i.e. round and right align.
Cell based access
headerLastCell :: a -> Table a -> Table aSource
alignLastCell :: Alignment -> Table a -> Table aSource
Set the alignemnt of the last cell.