Data tables display information in a way that’s easy to scan, so that users can look for patterns and insights.
import Material.DataTable
exposing
( dataTable
, dataTableCell
, dataTableCellConfig
, dataTableConfig
, dataTableHeaderCell
, dataTableHeaderCellConfig
, dataTableHeaderRow
, dataTableRow
, dataTableRowConfig
)
main =
dataTable dataTableConfig
{ thead =
[ dataTableHeaderRow []
[ dataTableHeaderCell
dataTableHeaderCellConfig
[ text "Desert" ]
]
]
, tbody =
[ dataTableRow dataTableRowConfig
[ dataTableCell dataTableCellConfig
[ text "Frozen yogurt" ]
]
]
}Default configuration of a data table
Header row view function
Header row type
Header cell view function
Header cell type
Default configuration of a header cell
Configuration of a header cell
dataTableHeaderCell
{ dataTableHeaderCellConfig | numeric = True }
[ text "Number" ]import Material.Checkbox exposing (checkboxConfig)
dataTableHeaderCell
{ dataTableHeaderCellConfig | checkbox = True }
[ dataTableHeaderRowCheckbox checkboxConfig ]Checkbox view function (header row variant)
Row view function
Row type
Default configuration of a row
Configuartion of a row
dataTableRow { dataTableRowConfig | selected = True }
[ … ]Cell view function
Cell type
Default configuration of a cell
Configuration of a cell
dataTableCell { dataTableCellConfig | numeric = True }
[ text "123" ]import Material.Checkbox exposing (checkboxConfig)
dataTableCell { dataTableCellConfig | checkbox = True }
[ dataTableRowCheckbox checkboxConfig ]Checkbox view function (row variant)
Data Table view function