xhtml-3000.2.1: An XHTML combinator library

Safe Haskell | Safe

Text.XHtml.Table

Description

Table combinators for XHTML.

Synopsis

- data HtmlTable
- class HTMLTABLE ht where
  - cell :: ht -> HtmlTable
- (</>) :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable
- above :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable
- (<->) :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable
- beside :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable
- aboves :: HTMLTABLE ht => [ht] -> HtmlTable
- besides :: HTMLTABLE ht => [ht] -> HtmlTable
- simpleTable :: [HtmlAttr] -> [HtmlAttr] -> [[Html]] -> Html

# Documentation

data HtmlTable

We internally represent the Cell inside a Table with an object of the type

    	   Int -> Int -> Html

When we render it later, we find out how many columns or rows this cell will span over, and can include the correct colspan/rowspan command.

Instances

Show HtmlTable |
HTML HtmlTable |
HTMLTABLE HtmlTable |

class HTMLTABLE ht where

Methods

cell :: ht -> HtmlTable

Instances

HTMLTABLE Html |
HTMLTABLE HtmlTable |

(</>) :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable

above :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable

(<->) :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable

beside :: (HTMLTABLE ht1, HTMLTABLE ht2) => ht1 -> ht2 -> HtmlTable

aboves :: HTMLTABLE ht => [ht] -> HtmlTable

besides :: HTMLTABLE ht => [ht] -> HtmlTable

simpleTable :: [HtmlAttr] -> [HtmlAttr] -> [[Html]] -> Html

If you can't be bothered with the above, then you can build simple tables with simpleTable. Just provide the attributes for the whole table, attributes for the cells (same for every cell), and a list of lists of cell contents, and this function will build the table for you. It does presume that all the lists are non-empty, and there is at least one list.

Different length lists means that the last cell gets padded. If you want more power, then use the system above, or build tables explicitly.