Version 6.3 Released!

Click to checkout the new features

Old Documentation
You are browsing documentation for an old version of Tabulator. Consider upgrading your project to Tabulator 6.3

Setup Options

Overview

Tabulator has a wide range of setup options to help you customise the user experience of your tables. This section outlines all the available options and links to the relevant section in this documentation to show you how to use them.

Each of these options can be set in the constructor object when you define your Tabulator.

var table = new Tabulator("#example-table", {
    height:"300px", //set the table height option
});

General Table Configuration

Option Data Type Default Value Description
heightstring/intfalseSets the height of the containing element, can be set to any valid height css value. If set to false (the default), the height of the table will resize to fit the table data.
minHeightstring/intfalseSets the minimum height for the table, can be set to any valid height css value.
maxHeightstring/intfalseSets the maximum height for the table, can be set to any valid height css value.
virtualDombooleantrueEnable/disable rendering using the Virtual DOM engine
virtualDomBufferintegerfalseManually set the size of the virtual DOM buffer
virtualDomHozbooleanfalseEnable/disable rendering using the Horizontal Virtual DOM engine
placeholderstring/DOM Node""placeholder element to display on empty table
footerElementstring/DOM Node(see documentation)Footer element for the table
tooltipsboolean/functionfalseFunction to generate tooltips for cells
tooltipGenerationModestring"load"When to regenerate cell tooltip value
historyboolean/functionfalseEnable user interaction history functionality
keybindingsboolean/functionfalseKeybinding configuration object
localestring/booleanfalseset the current localization language
langsobject(see documentation)hold localization templates
downloadConfigobjectobjectchoose which parts of the table are included in downloaded files
downloadRowRangestring"active"set the range of rows to be included in the downloaded table output
htmlOutputConfigobjectobjectchoose which parts of the table are included in getHtml function output
reactiveDatabooleanfalseenable data reactivity
tabEndNewRowboolean/object/functionfalseadd new row when user tabs of the end of the table
validationModestring"blocking"set validation mode of the table
textDirectionstring"auto"set text direction for the table
invalidOptionWarningsbooleantrueshow console warnings if invalid options are used

Columns

Option Data Type Default Value Description
columnsarray[]Holder for column definition array
autoColumnsbooleanfalseAutomatically generate column definitions for the table based on the structure of the first row of data
autoColumnsDefinitionsfunction/array/objectfalseManipulate the automatically generated column definitions
layoutstring"fitData"Layout mode for the table columns
layoutColumnsOnNewDatabooleanfalseChange column widths to match data when loaded into table
responsiveLayoutbooleanfalseAutomatically hide/show columns to fit the width of the Tabulator element
responsiveLayoutCollapseStartOpenbooleantrueshow collapsed column list
responsiveLayoutCollapseUseFormattersbooleantrueuse formatters in collapsed column lists
responsiveLayoutCollapseFormatterfunctioncreate contents of collapsed column list
cellHozAlignstring"left"horizontal alignment for cell contents
cellVertAlignstring"top"vertical alignment for cell contents
headerHozAlignstring"left"horizontal alignment for column header title
columnMinWidthinteger40Minimum width for a column in px
columnMaxWidthintegerMaximum width for a column in px
resizableColumnsbooleantrueAllow user to resize columns (via handles on the left and right edges of the column header)
movableColumnsbooleanfalseAllow users to move and reorder columns
tooltipsHeaderboolean/functionfalseFunction to generate tooltips for column headers
columnHeaderVertAlignstringtopVertical alignment for contents of column header (used in column grouping)
headerFilterPlaceholderstring"filter column..."The placeholder text to be set in any header filter input elements
scrollToColumnPositionstring"left"Default column position after scrollToColumn
scrollToColumnIfVisiblebooleanfalseAllow currently visible columns to be scrolled to
columnCalcsstring/booleantrueWhere to show column calcs in table
nestedFieldSeparatorstring/boolean"."Character used to separate nested fields in column definition
headerVisiblebooleantrueDisable column header bar

Rows

Option Data Type Default Value Description
rowFormatterfunction/booleanfalseFunction to alter layout of rows
rowFormatterPrintfunction/booleannullFunction to alter layout of rows when printed
rowFormatterClipboardfunction/booleannullFunction to alter layout of rows when copied to the clipboard
rowFormatterHtmlOutputfunction/booleannullFunction to alter layout of rows when the getHtml formatter is called
addRowPosstring"bottom"The position in the table for new rows to be added, "bottom" or "top"
selectableboolean/integer/string"highlight"Enable/Disable row selection
selectableRollingSelectionbooleantrueAllow rolling selection
selectablePersistencebooleantrueMaintain selected rows on filter or sort
selectableCheckfunction(see documentation)Check if row should be selectable or unselectable
movableRowsbooleanfalseAllow users to move and reorder rows
movableRowsConnectedTablesstring/DOM NodefalseConnection selector for receiving tables
movableRowsSenderstring/function/booleanfalseSender function to be executed when row has been sent
movableRowsReceiverstring/function"insert"Sender function to be executed when row has been received
movableRowsConnectedElementsstring/DOM NodefalseConnection selector for receiving elements
movableRowsElementDropfunctionfalseCallback executed when a table row is dropped on a non Tabulator DOM element
resizableRowsbooleanfalseAllow user to resize rows (via handles on the top and bottom edges of the row)
scrollToRowPositionstring"top"Default row position after scrollToRow
scrollToRowIfVisiblebooleanfalseAllow currently visible rows to be scrolled to

Data

Option Data Type Default Value Description
indexstringidThe field to be used as the unique index for each row
dataarray[]Array to hold data that should be loaded on table creation
ajaxURLstring/booleanfalseURL for remote Ajax data loading
ajaxParamsobject{}Parameters to be passed to remote Ajax data loading request
ajaxConfigstring/object"GET"The HTTP request type for Ajax requests or config object for the request
ajaxContentTypestring/object"form"set the content encoding for the json request
ajaxURLGeneratorfunctionfalsecallback function to generate request URL
ajaxRequestFuncfunctionfalsecallback function to replace inbuilt ajax request functionality
ajaxFilteringbooleanfalseSend filter config to server instead of processing locally
ajaxSortingbooleanfalseSend sorter config to server instead of processing locally
ajaxProgressiveLoadbooleanfalseProgressively load data into the table in chunks