The type of the data object for each row
Any other virtual element properties, including attributes and event handlers.
Optional
centeredCenter-align all table content
Optional
classThe class name(s) for this virtual element, as a space-separated list.
Optional
classAdditional 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
Optional
emptyMessage to display when data array is empty
Optional
enableShow global search input above the table
Optional
filterCurrent filter state. If provided, filtering is controlled externally
Optional
getFunction to generate custom CSS classes for each row
Optional
heightFixed table height in pixels (enables scrolling)
Optional
hoverableEnable row highlighting on hover
Optional
i18nInternationalization configuration for UI text
Optional
idCustom HTML id attribute for the table container
Optional
keyA key to optionally associate with this element.
Optional
loadingShow loading spinner and disable interactions
Optional
onCallback invoked when filter values change
Optional
onCallback invoked when user changes page or page size
Optional
onCallback invoked when a row is clicked
Optional
onCallback invoked when a row is double-clicked
Optional
onCallback invoked when user changes sort order
Optional
paginationPagination configuration. If provided, pagination is controlled externally
Optional
responsiveMake table responsive with horizontal scrolling on small screens
Optional
searchPlaceholder text for the global search input
Optional
selectionRow selection configuration
Optional
sortCurrent sort configuration. If provided, sorting is controlled externally
Optional
stripedApply alternating row background colors
Optional
titleOptional title displayed above the table
Optional
onbeforeremoveThe 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.
Optional
onbeforeupdateThe onbeforeupdate hook is called before a vnode is diffed in a update.
Optional
oncreateThe oncreate hook is called after a DOM element is created and attached to the document.
Optional
oninitThe oninit hook is called before a vnode is touched by the virtual DOM engine.
Optional
onremoveThe onremove hook is called before a DOM element is removed from the document.
Optional
onupdateThe 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