The type of the data object for each row
Any other virtual element properties, including attributes and event handlers.
OptionalcenteredCenter-align all table content
OptionalclassThe class name(s) for this virtual element, as a space-separated list.
OptionalclassAdditional CSS classes to apply to the table
Column configuration array defining how data should be displayed
Array of data objects to display in the table
OptionalemptyMessage to display when data array is empty
OptionalenableShow global search input above the table
OptionalfilterCurrent filter state. If provided, filtering is controlled externally
OptionalgetFunction to generate custom CSS classes for each row
OptionalheightFixed table height in pixels (enables scrolling)
OptionalhoverableEnable row highlighting on hover
Optionali18nInternationalization configuration for UI text
OptionalidCustom HTML id attribute for the table container
OptionalkeyA key to optionally associate with this element.
OptionalloadingShow loading spinner and disable interactions
OptionalonCallback invoked when filter values change
OptionalonCallback invoked when user changes page or page size
OptionalonCallback invoked when a row is clicked
OptionalonCallback invoked when a row is double-clicked
OptionalonCallback invoked when user changes sort order
OptionalpaginationPagination configuration. If provided, pagination is controlled externally
OptionalresponsiveMake table responsive with horizontal scrolling on small screens
OptionalsearchPlaceholder text for the global search input
OptionalselectionRow selection configuration
OptionalsortCurrent sort configuration. If provided, sorting is controlled externally
OptionalstripedApply alternating row background colors
OptionaltitleOptional title displayed above the table
OptionalonbeforeremoveThe onbeforeremove hook is called before a DOM element is detached from the document. If a Promise is returned, Mithril only detaches the DOM element after the promise completes.
OptionalonbeforeupdateThe onbeforeupdate hook is called before a vnode is diffed in a update.
OptionaloncreateThe oncreate hook is called after a DOM element is created and attached to the document.
OptionaloninitThe oninit hook is called before a vnode is touched by the virtual DOM engine.
OptionalonremoveThe onremove hook is called before a DOM element is removed from the document.
OptionalonupdateThe onupdate hook is called after a DOM element is updated, while attached to the document.
Main DataTable component attributes
Example: Basic usage
Example: With pagination and selection