gribouille / elm-table-tailwind / Table.Column

Configure the table's columns.


type alias Column a msg =
Internal.Column.Column a msg

Column's configuration (opaque).


type alias ViewCell a msg =
Internal.Column.ViewCell a msg

Function to render a cell.


type alias ViewHeader a msg =
Internal.Column.ViewHeader a msg

Function to render the column's header.

Constructors

bool : (a -> Basics.Bool) -> String -> String -> String -> Column a msg

Create a column for booleans.

default : String -> String -> String -> ViewCell a msg -> Column a msg

Create an agnostic column with a rendering function.

float : (a -> Basics.Float) -> String -> String -> String -> Column a msg

Create a column for floats.

int : (a -> Basics.Int) -> String -> String -> String -> Column a msg

Create an column for integers.

string : (a -> String) -> String -> String -> String -> Column a msg

Create a column for strings.

Customization

withClass : String -> Column a msg -> Column a msg

Define a CSS class for the column.

withDefault : Basics.Bool -> Column a msg -> Column a msg

Define a column visible by default.

withHeaderView : ViewHeader a msg -> Column a msg -> Column a msg

Define a specific function to render the header.

withHiddable : Basics.Bool -> Column a msg -> Column a msg

Define a hiddable column.

withHidden : Column a msg -> Column a msg

Define a hidden column.

withSearchable : Maybe (a -> String) -> Column a msg -> Column a msg

Define a function to filter the data in the table (usefull only for the static table).

withSortable : Maybe (a -> a -> Basics.Order) -> Column a msg -> Column a msg

Define a function to sort the data (for the dynamic table, a fake function should be defined here and capture the pagination in the update function to load the sorted data).

withUnSortable : Column a msg -> Column a msg

Define an unsortable column.

withView : ViewCell a msg -> Column a msg -> Column a msg

Define a specific function to render the value.

withWidth : String -> Column a msg -> Column a msg

Define a static width (CSS value).