Skip to main content

Table

Ant Design

The Table component is Ant Design's data table. It shows rows of records, such as orders or users from a query, with formatted columns, sorting, pagination and row selection.

Properties​

Property
Description
Expected Value
Data sourceRows to show, such as {{queries.getOrders.data}}.Array
ColumnsThe columns, each with a title and the dataIndex field it shows, plus optional format, align, width and sorter. format can be number, currency (or currency:EUR), percent, date, datetime, tag, boolean or html. Leave it empty to show every field.Array
TitleHeading shown above the rows. {count} is replaced with the number of rows.Text
Row keyField that identifies each row, such as id. selectedRowKeys and Select row use it.Text. Default: id
PaginationSplits the rows into pages with page buttons under the table.On or off. Default: On
Page sizeNumber of rows on each page.Number. Default: 10
BorderedDraws borders around the table and between cells.On or off. Default: Off
SizeSpacing of the rows and cells.large, middle, small. Default: middle
Show headerShows the row of column titles.On or off. Default: On
Row selectionAdds a selection column. checkbox lets the user select several rows; radio selects one.none, checkbox, radio. Default: none
Empty textText shown when there are no rows.Text. Default: No data
CurrencyCurrency code, such as USD or EUR, for currency columns that don't name one.Text. Default: USD
LocaleLocale for number and date formatting, such as pt-BR. Leave it empty to follow the currency's usual format.Text
Tag colorsColors for values in tag columns, such as { "Paid": "green" }. Without one, words such as Paid or Overdue get a matching status color.Object

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On row clickTriggers when the user clicks a row.
On changeTriggers when the user changes the page or sorts a column.
On selection changeTriggers when the selected rows change through the selection column or an action.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Select rowHighlights the row whose Row key field matches the given value. With Row selection on, it also selects the row, adding it to the selection in checkbox mode.components.table1.selectRow("")
Clear selectionClears the clicked row and the selected rows.components.table1.clearSelection()
Go to pageGoes to the given Page (from 1).components.table1.setCurrent("")
Set visibilityShows the component when true, hides it when false.components.table1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.table1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.table1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataSourceRows to show, such as {{queries.getOrders.data}}.{{components.table1.dataSource}}
columnsThe columns, each with a title and the dataIndex field it shows, plus optional format, align, width and sorter. format can be number, currency (or currency:EUR), percent, date, datetime, tag, boolean or html. Leave it empty to show every field.{{components.table1.columns}}
titleHeading shown above the rows. {count} is replaced with the number of rows.{{components.table1.title}}
rowKeyField that identifies each row, such as id. selectedRowKeys and Select row use it.{{components.table1.rowKey}}
paginationSplits the rows into pages with page buttons under the table.{{components.table1.pagination}}
pageSizeNumber of rows on each page.{{components.table1.pageSize}}
borderedDraws borders around the table and between cells.{{components.table1.bordered}}
sizeSpacing of the rows and cells.{{components.table1.size}}
showHeaderShows the row of column titles.{{components.table1.showHeader}}
rowSelectionAdds a selection column. checkbox lets the user select several rows; radio selects one.{{components.table1.rowSelection}}
emptyTextText shown when there are no rows.{{components.table1.emptyText}}
currencyCurrency code, such as USD or EUR, for currency columns that don't name one.{{components.table1.currency}}
localeLocale for number and date formatting, such as pt-BR. Leave it empty to follow the currency's usual format.{{components.table1.locale}}
tagColorsColors for values in tag columns, such as { "Paid": "green" }. Without one, words such as Paid or Overdue get a matching status color.{{components.table1.tagColors}}
selectedRowThe data of the row the user clicked last, or {}.{{components.table1.selectedRow}}
selectedRowKeysRow key values of the rows selected in the selection column.{{components.table1.selectedRowKeys}}
selectedRowsThe data of the rows selected in the selection column.{{components.table1.selectedRows}}
currentThe page shown, counting from 1.{{components.table1.current}}
isVisibleWhether the component is visible.{{components.table1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.table1.isLoading}}
isDisabledWhether the component is disabled.{{components.table1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.