Creates a customizable Table component by using predefined Html syntax.
Represents the table skin.
Represents the basic state of the component.
Represents an Header of the table. It's gonna be rendered as a
Represents a Row which contains a list of Columns.
Represents a Column which can manage a specific kind of data.
Represents the colSpan of a column. Alias for Integer.
Represents the sort algorithm
Returns the config of the component.
...
type Msg =
SortBy String
...
myTableConfig : Table.Config
myTableConfig =
let
headers : List (Table.Header Msg)
headers =
List.map (\content -> Table.header (String.toLower content) content SortBy) [ "Country", "Capital city" ]
rows : List (Table.Row Msg)
rows =
List.map (Table.row << List.map Table.columnString ) [ ["Italy", "Rome"], ["France", "Paris"], ["U.K.", "London"] ]
alternateRows =
True
createFooterColumns : List String -> List (Table.FooterColumn Msg)
createFooterColumns columns =
List.map (Table.footerColumnString 1) columns
footer : List (Table.FooterRow Msg)
footer =
[ Table.footerRow (createFooterColumns [ "Country", "Capital city" ]) ]
in
Table.config Table.defaultType sorting headers rows alternateRows footerColumns [("my-custom-class", True)]
...Creates an initial State defined by Sort and Column.
Represents the Default table skin.
Represents the Alternative table skin.
Creates and Header.
myHeader : String -> String -> (String -> Msg) -> Table.Header Msg
myHeader slug content sortByTagger =
Table.header slug content sortByTaggerCreates a Row
myRow : List (Column Msg) -> Table.Row Msg
myRow columns =
Table.row columnsCreates a Column which content is Float primitive.
Creates a Column which content is Html.
Creates a Column which content is Integer primitive.
Creates a Column which content is String primitive.
Represents the static configuration of the component.