Ant Design Svelte

Table

Tables: columns, filters, sorting, selection, pagination, expansion, scrolling and server data.

When to use

Table displays records with the same fields, such as participants, orders, or tasks. Columns let you compare values, sort and filter data, and select rows for a bulk action. You can expand child records within the table. To navigate a hierarchy of sections, use Tree.

Pass records through dataSource. Supply a columns array or declare columns inside the table with Table.Column and Table.ColumnGroup. The grouping example shows nested columns.

Records and columns

Each record needs a unique stable key: record.key or rowKey. It links DOM, selection and expansion. Use a string or a final number, preserving the key when sorting, editing, and getting a new page.

Problem Setting Example
Show typed entries dataSource, columns, rowKey Regular table
Sort and filter locally sorter, onFilter in column Filters and sorting
Select rows for action rowSelection, selectedRowKeys Choice and Action
Show a hierarchy of records children Tree rows
Load pages with application mode="server", onChange Server mode
Open entry details expandable Expandable Strings

A string in dataIndex names a record key. An array gives the path to a nested value. The render snippet receives the record, its index among siblings, and the original value.

Set an explicit column key with a string or number. If key is omitted, Table uses dataIndex or, for a column without a field, its position. Give columns that can be reordered stable keys. Filter and sort events report string keys.

Use column to share column settings. The minWidth option sets the minimum width with tableLayout="auto". Use ellipsis for long text and set { showTitle: false } when a custom tooltip provides the full text. Purchase requests example.

Use shouldCellUpdate to compare a new record with the last accepted record when the cell content depends on specific fields. Replace a changed record with a new object. Task editing example.

Use hidden to change which columns the app displays. Sorting and filtering for a hidden column still apply. Column visibility example.

Use children to give several columns a shared header. The responsive option on a top-level column or group controls which viewport widths show it. Workload example.

Set colSpan or rowSpan to merge cells. For header cells, set spans on the column or return them from onHeaderCell. For data cells, return them from onCell. A span of zero skips a cell already covered by the merged cell. Release checklist example.

Use onRow and onHeaderRow to return HTML attributes and Svelte event handlers. The data row index is its position on the entire expanded page. The header row index starts at zero and corresponds to its level.

Sorting, filters and pages

In client mode, sorter orders records and onFilter checks them against the applied conditions. In server mode, the app handles requests in onChange and supplies the resulting page.

Set multiple on sortable columns to combine criteria. The highest priority is compared first. The app accepts sorters from the event and sets each column's sortOrder. The showSorterTooltip option displays the next action. Sort by team and task count.

Set children for nested filter options. With filterMode: 'tree', users can expand branches, and filterSearch helps them find an option. The title snippet receives the applied filters and sort orders. Find teams in a tree.

Use defaultFilteredValue for an initial condition. To control it in the app, pass filteredValue and update it from onChange. In a custom filterDropdown, change the draft with setSelectedKeys and apply it with confirm(). The getPopupContainer option sets the popup host. Numeric filter example.

filterIcon and filterDropdown also accept static content. If a custom filter applies a value without onFilter, onChange receives it and the rows stay visible. Other active filters still apply. An option’s filters[].text can contain a number or a snippet. Provide a filterSearch function to search rich labels.

The available states are bind:sorter, bind:filters, bind:current and bind:pageSize. The corresponding default props specify only the initial local state. The filter or sorting is reset by assigning it to the current state. Managed filters show such a reset separately.

After filtering, the table returns to the first page. Use pagination.placement to show pagination above the table, below it, or in both places. Both sets of controls share the page number and size. Pagination example.

In server mode, pass the current page dataSource, total and loading. Table itself does not execute the query. Server example uses a local simulator and model that discards stale results, repeats the last request, and is released on unmount.

Pass Spin options to loading to set a delay and description. Use undefined or null for dataSource while the result is unknown. An empty array represents a result with no records. Use locale for the labels and empty state of an individual table. Loading and empty state example.

Select, expand and scroll

Set rowSelection.type to checkbox for multiple rows or radio for a single row. In checkbox mode, use Shift to select a range, and use selections to add bulk commands. Selection modes example.

Set controlled keys in rowSelection.selectedRowKeys and update them from rowSelection.onChange. When loading pages from a server, preserveSelectedRowKeys keeps the selected records when dataSource changes. Table also supports bind:selectedRowKeys.

Use expandedRowRender to add a details row. The rowExpandable option determines which records can show details. The Nested table example shows a participant's tasks in a separate table within that row.

Place Table.EXPAND_COLUMN and Table.SELECTION_COLUMN in the column array to position the built-in controls. Set expandIcon on the expansion options or in ConfigProvider.table to render your own button. Use renderCell to wrap the standard selection control, for example in a tooltip. With forceRender, a draft survives collapsing the details as long as its row stays in the DOM. Participant notes example.

scroll.x sets the minimum table width, scroll.y limits the vertical scrolling area. fixed=true/start/end fixes columns at logical edges taking into account RTL; If there is not enough space, pinning is disabled. Scrolling example shows the header and columns within its scroll region.

Use caption or aria-label to name the table. The showHeader option controls column headers, and rowHoverable controls row highlighting. Apply styles with class/style, column.className, rowClassName, and component design tokens.

Use classNames and styles to style specific elements such as header and body cells. Both accept an object or a function of the table props. The components.body.row snippet can extend a row's markup. Pass the supplied attributes, child snippet, and ref to the native element to retain its events and measurements. Row styling example.

Table inherits ConfigProvider.prefixCls with the suffix -table. A non-empty local prefixCls specifies the full name of the wrapper, rows, cells, sort and filter elements; empty string/undefined return the general prefix. Checkbox, Pagination and Button resolve their common prefix regardless of Table. Table CSS prefixes also shows the expanded line editor, RTL and separate namespace CSS variables.

dropdownPrefixCls sets the filter list prefix, with -menu appended. The popup shell, Checkbox and Button inherit the shared prefix.

In the caption example, the caption snippet names both the table and its scroll region. role and aria-* apply to the table element, while id and data-* go on its inner container.

Changing names preserves the editor's DOM, text, focus, selection, and FormData, as well as selection, expand, page, sort, open filter draft, and scrolling. The theme.components.Table and marker ant-table-css-var tokens are not renamed along with the classes. Namespace theme.cssVar.prefix is ​​set separately; The nested-border-top service variable uses the common provider prefix without dots. Light, dark and compact themes work without CSS variables. Changing the prefix preserves the height of the table, including its pagination.

Virtual scrolling and totals

Enable virtual and set numeric scroll.x and scroll.y in pixels to render a window of rows. Table measures the exact heights after hydration. Selection applies to the entire current page, including rows outside the window. Check runs example.

Get a TableRef with bind:this and call scrollTo with a vertical offset, a key, or a row index on the current page. Use onScroll to track the window's vertical position. The scrollToFirstRowOnChange option controls whether changes to sorting, filters, or pagination scroll back to the start.

Use the components.body snippet to render rows in your own scroll region. Pass info.ref and info.onScroll to the container to sync horizontal scrolling with the header and keep scrolling by key. Share rowKey and scroll through ConfigProvider.table. A local scroll replaces the shared object. Custom check list example.

The title, footer, and summary snippets receive the current page's records. Table.Summary renders totals in tfoot. The Table.Summary.Cell index includes visible selection and expansion columns. Set fixed: 'bottom' or fixed: 'top' in summary to pin the totals in a table with a scroll height or with sticky.

Use sticky to pin the header and an additional horizontal scrollbar as the page scrolls. Set getContainer to use a different scroll region. In the totals example, the report scrolls within its card and the total updates when you change pages.

Tree rows

Pass child records in the children array. If your data uses a different field, set expandable.childrenColumnName. Each key must be unique across the entire table, including collapsed branches. The release tasks example shows three levels of rows.

Set the initially expanded rows with defaultExpandedRowKeys, or expand the entire initial page with defaultExpandAllRows. If the application controls expansion, update expandedRowKeys inside expandable when onExpandedRowsChange fires. Use indentSize to set the indentation per level.

Row checkboxes are independent by default. With checkStrictly: false in rowSelection, selecting a parent also selects its available descendants. When only part of a branch is selected, the parent checkbox shows a mixed state. The header checkbox selects available rows on the current page, including descendants in collapsed branches.

Client-side sorting orders sibling rows at each level. Filtering checks records at every level. If a parent fails the filter, its branch is hidden. Pagination counts top-level rows, and descendants stay on their parent's page.

Examples

Regular table

columns, dataSource and the actual caption.

—

Choice and action

Checkbox, disabled recording and saving keys between pages.

Selection modes and commands

Switch to single selection or use the bulk actions menu.

Tree rows

Expand the release tasks and try selecting an entire branch or individual rows.

—

Filters and sorting

Comparator, onFilter and one TableChange object.

Sorting by multiple columns

Sort participants within each team. Team has the highest priority.

Search in tree filters

Find a team in the filter. Reset restores the initial Design selection.

Custom filter panel

Enter a minimum task count and apply the filter.

Controllable filters

bind:sorter/filters, reset and software setting of state.

Size and limits

small/medium/large and bordered; title - caption.

Dock and scroll

Inner scroll.y, horizontal scroll.x and fixed start/end.

Virtual scrolling

Scroll through a thousand records or jump to the last by its key.

List with a custom scroll region

The header and scrolling by key work with a custom list.

Speaker composition

column.hidden hides cells while preserving sorting and filters.

Column widths and long text

Switch the layout algorithm. Hover over a request description to read it in full.

Grouped and responsive columns

Table.ColumnGroup groups the Team and Tasks columns. Table.Column uses responsive to show the Access column from md upwards.

Merged cells

A section spans multiple rows, and the note spans the table.

—

Editing a cell

The numeric cell accepts a new record when its task count changes.

Nested table

An expanded details row shows the participant's tasks in a separate table.

Empty table
Name
Team
Tasks
There are no participants in this table yet

Empty data and loading

A local empty state and a delayed loading indicator.

Page: 1; lines: 3

Pagination

Add pagination above the table and change the page using either set of controls.

Total: 0. Page: 1. Selected: 0.

Server mode

Snapshot query, cancel outdated query, error and retry. Data is simulated locally.

Revealed: 1. Selected: 0.

Expandable strings

Details, rowExpandable, selecting and saving expandable.expandedRowKeys between pages. The owner updates the keys via expandable.onExpandedRowsChange.

Service columns and expansion

Open a note, type a draft, and collapse the row. Your draft is kept.

Panels, headers and rows

title/footer get the current page; showHeader, rowHoverable, rowClassName and rowScope.

Pinned header and totals

Scroll the report inside the card. The total updates with the page.

Styling table elements

Compact cells with styles and a row with an extra HTML attribute.

Component theme

Header, cell and footer tokens, row selection, dimensions, nested theme and RTL.

—
Page: 1; selected: 1; revealed: 1 No events Table: project-grid; filter list: project-filters-menu

Local prefixCls specifies the full name of the Table, dropdownPrefixCls specifies the base name of the filter list with the addition of -menu. An empty string returns the provider prefix. The Filter wrapper, Checkbox, Pagination, Button and Input independently inherit a common namespace. Changing names preserves the opened line, editor, selection, page and draft of the opened filter; CSS variables are set separately.

CSS table prefixes

General and local prefixCls, separate dropdownPrefixCls, RTL and CSS variables. The expanded line editor, selection, filters and pagination are preserved when changing names.

API

The examples use Ant Design 6.6.8 as a reference and the public @woodger/antd API.

Example themes
ThemeExample or limitation
Basic UsageTyped columns, dataSource and rowKey.
JSX style APITable.Column and Table.ColumnGroup declare columns and groups inside the table.
selectionSelect one or more participants with Radio and Checkbox.
Selection and operationOwner action on selectedRowKeys.
Custom selectionCommands to select all records, invert the current page, or clear the selection.
Filter and sorterComparator and flat filter list.
Filter in TreeA filter with expandable groups of options.
Filter searchFind options with filterSearch.
Multiple sorterSort by team, then by task count.
Reset filters and sortersThe condition belongs to the owner.
Customized filter panelPanel snippet with a numeric threshold and custom icon.
Ajaxmode=server with total; local source demonstrates request, cancellation, error and retry.
sizesmall/medium/large; inheritance componentSize.
border, title and footerbordered, caption and title/footer snippets with current page data.
Expandable RowexpandedRowRender and rowExpandable.
Expand all rowsThe example controls expansion in the app. Use defaultExpandAllRows to expand rows initially.
Order Specific ColumnTable.EXPAND_COLUMN and Table.SELECTION_COLUMN set the column order.
colSpan and rowSpanHeader and data cells can span multiple rows or columns.
Tree dataRows nested through children, with linked selection.
Fixed HeaderThe title is fixed inside scroll.y.
Auto heightThere is no automatic calculation of window height.
Fixed Columnsfixed true/start/end, numeric width and horizontal scrolling.
Stack Fixed ColumnsSequential consolidation is not transferred.
Fixed Columns and HeaderCollaboration between scroll.x/y and fixed.
Hidden Columnscolumn.hidden removes cells from the DOM while maintaining column sorting and filters.
Grouping table headChild columns in children form a multi-level header.
Editable CellsSnippet and InputNumber, the editing state belongs to the example.
Editable RowsShows owner save; onRow/components and there is no built-in editable row.
Nested tablesTable composition inside expandedRowRender.
Drag sortingDrag-and-drop lines are not built in.
Drag Column sortingNo drag-and-drop speakers.
Drag sorting with handlerNo handler/components for drag-and-drop.
ellipsis columnTruncates text in a column of a set width.
Shared column propsShared width and alignment through the column prop.
ellipsis column custom tooltipBuilt-in truncation with a Tooltip showing the full text.
Custom emptyEmpty snippet and RenderEmpty from ConfigProvider.
SummaryTable.Summary renders totals for the current page.
Virtual listRenders a window of rows. Jump to a record with scrollTo.
ResponsiveThe responsive option controls column visibility at different viewport widths.
Pagination SettingsPlace pagination above and below the table with pagination.placement.
Fixed header and scroll bar with the pageThe sticky option pins the header and scrollbar within the chosen region.
Dynamic SettingsAvailable size/border settings plus separate loading, scroll, selection examples.
Custom semantic dom stylingHeader classes and cell styles with classNames and styles.
Custom bodyCustom body linked to the header and scrollTo.
Conditional cell updatesEditor with content updates controlled by shouldCellUpdate.

Table

PropertyDescriptionTypeDefault
prefixClsThe fully qualified local name of the Table, including wrapper, rows, cells, and filter elements. The empty string/undefined select ConfigProvider. Nested controls retain an independent common prefix.stringGeneral prefix + -table
dropdownPrefixClsFilter list base name: -menu is added. Does not change the common shell prefix of popup, Checkbox and Button; empty string/undefined return generic prefix.stringGeneral prefix + -dropdown
dataSourceTable records. An empty array represents a known empty result.readonly Row[] | null—
columnsArray of columns and groups. When provided, columns takes precedence over nested declarations.readonly TableColumnInput<Row>[]—
columnFills in omitted properties on columns and groups.TableColumnDefaults<Row>—
getPopupContainerContainer for filters and the selection commands menu.(trigger: HTMLElement) => HTMLElementFrom ConfigProvider
rowKeyRecord field or function that returns a stable, unique key.keyof Row | (record) => string | numberConfigProvider.table.rowKey / key
modeIn server, local filtering, sorting and slice are disabled.client | serverclient
totalTotal number of server records; in client it is calculated after filters.numberdataSource.length in server
sorterbind:sorter, one sort.TableSorter | nulllocal state
defaultSorterInitial sorting.TableSorter | nullnull
sortDirectionsOrder in which sort directions cycle.readonly (TableSortOrder | null)[]ascend, descend
showSorterTooltipTooltip for the next action on the header or sorter icon.boolean | TableSorterTooltipPropstrue
filtersbind:filters; column key → array of selected values.TableFilterslocal state
defaultFiltersInitial filters.Readonly<Record<string, readonly TableFilterValue[]>>{}
currentbind:current - page from one.numberlocal state
defaultCurrentHome page.number1
pageSizebind:pageSize — page size.numberlocal state
defaultPageSizeInitial number of rows.number10
paginationPagination options, including placement for one or two pagers.false | TablePaginationConfigincluded
rowSelectionCheckbox for selecting and setting up disabled entries.boolean | TableRowSelection<Row>false
selectedRowKeysbind:selectedRowKeys; the state is removed from rowSelection.TableKey[]local state
defaultSelectedRowKeysInitial choice.readonly TableKey[][]
onSelectionChangeReturns keys and selected records from dataSource, including descendants in collapsed branches.(keys, rows, {type: single | all}) => void—
onChangeFilters, sorting, and pagination in one TableChange object.(change: TableChange<Row>) => void—
expandableOptions for expanding child records and details rows.TableExpandable<Row>—
loadingLoading state and Spin settings, including delay and description.boolean | SpinPropsfalse
localeLocal labels for filters, actions, and the empty state.TableLocaleOverridesFrom ConfigProvider
tableLayoutColumn width algorithm for a standard table.'auto' | 'fixed'automatically
componentsCustom row and cell elements or a separate scrollable body.TableComponents<Row>—
classNamesClasses for named table elements.TableSemantic<Row, TableClassNameSlots>—
stylesCSS declarations for named table elements.TableSemantic<Row>—
rootClassNameAdditional class for the root and filter panels.string—
disabledDisable selection, sorting, filters and pagination.booleanConfigProvider.componentDisabled
borderedCell boundaries.booleanfalse
sizeRow size; medium adds the suffix -medium to the allowed Table prefix.small | medium | largeConfigProvider.componentSize
captionNative table label, separate from the visual title/footer.RenderEmptyContent—
titlePanel above the table. Gets the sorted and filtered records of the current page; in server - the passed dataSource.Snippet<[readonly Row[]]>—
footerPanel under the table with the same records of the current page; not summary and not tfoot.Snippet<[readonly Row[]]>—
showHeaderShow thead; hiding saves caption, rows and sort/filter state.booleantrue
rowClassNameRow class. Index is the position among visible rows on the page. Indent is the nesting level.string | (record, index, indent) => string—
onRowRow attributes and events. The index is relative to the expanded page.(record, index) => TableRowProps | void—
onHeaderRowHeader row attributes and events. The index is the header level.(columns, index) => TableRowProps | void—
rowHoverableHover highlight; does not disable selection, focus, and row actions.booleantrue
emptyContent when there are no entries and loading=false.SnippetRenderEmpty / Empty
scrollScroll dimensions and position reset after actions.TableScrollOptionsConfigProvider.table.scroll
virtualLimits the rendered rows when scroll.y specifies a height.booleanfalse
onScrollScroll event for the region. In virtual mode it reports vertical scrolling.(event: Event & { currentTarget: HTMLDivElement }) => void—
nativeElementRoot DOM element through bind:nativeElement.HTMLDivElement—
stickyPins the header and horizontal scrollbar.boolean | TableStickyfalse
summaryTotals for the current page, optionally pinned to the top or bottom.Snippet<[data: readonly Row[]]> | TableSummaryConfig<Row>—
idPassed to the inner table container alongside data-* attributes.string—
roleApplied to the table element along with aria-* attributes.HTMLTableAttributes["role"]—
aria-labelAvailable table name without caption.stringcaption / locale
classExternal wrapper class.string—
styleCSS external wrapper.string—

TableColumnInput

PropertyDescriptionTypeDefault
childrenColumns with a shared group header.readonly TableColumnInput<Row>[]—
responsiveGrid breakpoints at which a top-level column is visible.readonly GridBreakpoint[]—
colSpanNumber of columns spanned by the header cell. Zero hides the cell.number—
rowSpanNumber of rows spanned by the header cell. Zero hides the cell.number—
onCellCell attributes and spans. The index is relative to the expanded page.(record, index) => TableCellProps | void—
onHeaderCellHeader cell attributes. Can override the column's colSpan and rowSpan.(column) => TableCellProps | void—
hiddenHide a column from the DOM without removing its sorting and filters. fixed offsets only take into account visible columns.booleanfalse
classNameClass of header and column cells.string—
rowScopeMakes data cells real th with the specified scope.row | rowgroup—
keyAn omitted key comes from dataIndex or position. Filtering and sorting use a string key.string | numberdataIndex / position
titleText, a number, an array or a snippet receiving the current filters and sorting.TableColumnTitle<Row>—
dataIndexRecord key or path to a nested value.TableDataIndex<Row>—
renderReceives the record, index among siblings, and original value.Snippet<[record: Row, index: number, value?: unknown]>dataIndex value
shouldCellUpdateDecides whether to accept a new record for the cell content.(record: Row, previousRecord: Row) => boolean—
sorterComparator, object with a multiple priority, or server sort criterion.boolean | TableSortCompare<Row> | TableColumnSorter<Row>—
sortOrderSort direction controlled by the app. null clears the criterion.TableSortOrder | null—
defaultSortOrderInitial column sort direction.TableSortOrder | null—
sortDirectionsColumn-specific cycle of sort directions.readonly (TableSortOrder | null)[]From Table
sortIconCustom sort icon with the current direction.Snippet<[{ sortOrder: TableSortOrder | null }]>—
showSorterTooltipSorter tooltip settings for an individual column.boolean | TableSorterTooltipPropsFrom Table
filtersFilter options with optional child options.readonly TableFilterOption[]—
filterModeMenu or tree of options.'menu' | 'tree'menu
filterSearchSearch by label or use an app-provided predicate.TableFilterSearchfalse
filteredHighlights the filter independently of its selected values.booleanfalse
filteredValueApplied column values controlled by the app.readonly TableFilterValue[] | null—
defaultFilteredValueInitial filter values for the column.readonly TableFilterValue[] | null—
filterResetToDefaultFilteredValueReset restores the initial values in the draft.booleanfalse
filterDropdownCustom filter panel with draft values and actions.RenderEmptyContent | Snippet<[info: TableFilterDropdownProps]>—
filterDropdownPropsonOpenChange(open) reports requests to open or close the panel. Selecting an item updates the filter draft and keeps the panel open.TableFilterDropdownOptions—
filterOnCloseApplies the built-in filter draft when the user closes the panel.booleanfalse
filterIconCustom filter icon with an active state.RenderEmptyContent | Snippet<[filtered: boolean]>—
onFilterLocal check of one record.(value, record) => boolean—
filterMultipleAllow multiple filter values.booleantrue
alignAligns cell text.TableAlignCSS
widthWidth col; numbers in px.number | stringautomatically
minWidthMinimum width in pixels with auto layout and in the virtual window.number—
ellipsisTruncates text. showTitle controls the cell's native tooltip.boolean | { showTitle?: boolean }false
fixedsticky column; true means start. If docked columns do not fit, docking is disabled.boolean | start | endfalse

TableRowSelection

PropertyDescriptionTypeDefault
typeSelect multiple rows or a single row.'checkbox' | 'radio'checkbox
selectedRowKeysControlled keys. Take precedence over the Table prop with the same name.readonly TableKey[]local state
defaultSelectedRowKeysInitial choice.readonly TableKey[][]
onChangeNew keys, known records, and the selection method.(keys, rows, { type: TableRowSelectMethod }) => void—
onSelectSingle-row action. Called before onChange.(record, checked, rows, event) => void—
preserveSelectedRowKeysKeeps keys and remembers the selected records when dataSource changes.booleanfalse
selectionsCheckbox selection menu with built-in or custom commands.boolean | readonly (TableSelectionItem | TableSelectionPreset)[]false
hideSelectAllHide the header checkbox and selection menu.booleanfalse
getTitleCheckboxPropsAttributes and events for the header checkbox.() => TableSelectionControlProps—
columnTitleSelection header content. The snippet receives the original checkbox.RenderEmptyContent | Snippet<[checkbox: Snippet | undefined]>—
renderCellSelection cell content. Use origin to render the built-in control.Snippet<[checked, record, index, origin]>—
onCellSelection cell attributes and spans.(record, index) => TableCellProps | void—
checkStrictlySet to false to link selection between parents and descendants.booleantrue
fixedPin the selection column to a logical edge.TableFixedfalse
columnWidthWidth of the selection column.number | stringselectionColumnWidth
alignAlignment of the selection column content.TableAlign—
getCheckboxPropsAttributes of the row selection control, including disabled and aria-label.(record) => TableSelectionControlProps—

TableExpandable

PropertyDescriptionTypeDefault
expandedRowRenderContent for a separate details row, which can contain a nested Table.Snippet<[record: Row, index: number, indent: number, expanded: boolean]>—
forceRenderKeeps details content when the row collapses.booleanfalse
expandedRowClassNameClasses for the details row and child rows.string | (record, index, indent) => string—
expandIconCustom toggle with the expansion state and the original button in origin.Snippet<[info: TableExpandIconInfo<Row>, origin: Snippet]>—
expandedRowKeysManaged keys are expandable inside. The owner accepts the new array in onExpandedRowsChange.readonly TableKey[]local state
defaultExpandedRowKeysInitially disclosed records. Read once; a subsequent change does not reset the state.readonly TableKey[][]
defaultExpandAllRowsExpands branches on the initial page when defaultExpandedRowKeys is unset.booleanfalse
childrenColumnNameName of the field containing child records.stringchildren
indentSizeIndentation per nesting level in pixels.number15
expandRowByClickToggles expansion when a row is clicked.booleanfalse
showExpandColumnShows the details column or the expansion buttons in a tree.booleantrue
onExpandRequest to expand one row; called before onExpandedRowsChange.(expanded, record) => void—
onExpandedRowsChangeComplete new set of keys, including other pages. For managed state, update expandable.expandedRowKeys.(keys: TableKey[]) => void—
rowExpandableWhich records have details available.(record) => booleantrue
columnTitleName of the service column.RenderEmptyContentempty header
columnWidthWidth of the disclosure column.number | string48px
fixedPin the expansion column to a logical edge.TableFixedfalse

TableRef

PropertyDescriptionTypeDefault
scrollToScroll to a position or to a row on the current page by key or index.(config: TableScrollConfig) => void—

TableScrollOptions

PropertyDescriptionTypeDefault
xTable width. true sizes it to the content.number | string | true—
yScroll region height. In virtual mode, use a number of pixels.number | string—
scrollToFirstRowOnChangeScroll to the start after the user sorts, filters, or changes pages.booleanvirtual

TablePaginationConfig

PropertyDescriptionTypeDefault
placementAlignment above and below the table. An empty array hides the controls.readonly TablePaginationPlacement[]bottomEnd

TableSticky

PropertyDescriptionTypeDefault
offsetHeaderTop offset of the header in pixels.number0
offsetSummaryBottom offset of the totals in pixels.number0
offsetScrollBottom offset of the additional scrollbar in pixels.number0
getContainerReturns the scroll region. Defaults to the table's window.() => HTMLElement | Window | null | undefined—

TableChange

PropertyDescriptionTypeDefault
actionReason for change.sort | paginate | filter—
paginationCurrent page and size.{current, pageSize, total}—
sorterFirst active sort criterion.TableSorter | null—
sortersAll active criteria when sorting by multiple columns.TableSorter[]—
filtersValues ​​by column keys when the table has filters.TableFilters | undefined—
currentDataSourceRoot rows with their child records. In client mode, this is the result after sorting and filtering, before pagination.Row[]—

TableSorter

PropertyDescriptionTypeDefault
columnKeykey of the sortable column.stringis required
orderDirection; null total sorter means no sorting.ascend | descendis required

TableFilterOption

PropertyDescriptionTypeDefault
textVariant label.RenderEmptyContentis required
valueValue in filters and onFilter.string | number | booleanis required
childrenOptions within a filter group.readonly TableFilterOption[]—

The onChange handler receives a TableChange object. The render snippet receives the record, index, and original value. Define column groups with children in columns.

Semantic DOM

Use classNames and styles to style named elements. Provider and table settings are merged for each element.

The classes below are shown for a standard ant-table. prefixCls replaces this part of the names; marker ant-table-css-var is saved. Checkbox, Button and Pagination independently use a common provider prefix; pagination additionally gets the Table owner class with -pagination. dropdownPrefixCls only changes the name of the list inside the filter, with the suffix -menu.

Actual markings
ElementPurpose
.ant-table-wrapperRoot class/style and RTL direction.
.ant-table-contentFocusable role=region with internal scrolling.
table / captionNative table structure and accessible name.
.ant-table-theadHeader th elements with scope=col or colgroup and aria-sort.
.ant-table-column-sortersSort button accessible from the keyboard.
.ant-table-tbodyData lines.
.ant-table-selection-columnHeader checkbox and commands, plus Checkbox or Radio in data rows.
tfootTable.Summary rows.
.ant-table-sticky-scrollAdditional horizontal scrollbar.
.ant-table-row-expand-iconExpand button with aria-expanded/aria-controls.
.ant-table-expanded-rowDetails line.
.ant-table-placeholderContents empty when there are no records.
.ant-table-title / .ant-table-footerVisual panels with the current page.
th[scope=row] / th[scope=rowgroup]Row headers specified by column.rowScope.
.ant-table-paginationSeparate navigation Pagination.
Named Table elements
ElementPurpose
rootOuter container.
sectionContainer around the scrollable region.
contentScroll region of a standard table without a fixed header.
title / footerPanels above and below the table.
header.wrapper / header.row / header.cellHeader wrapper, rows, and cells.
body.wrapper / body.row / body.cellBody wrapper, data rows, and cells.
pagination.root / pagination.itemPagination container and items.

Registration tokens

Set table styles with theme.components.Table. Design tokens control dimensions, backgrounds, borders, filters, and the sticky scrollbar.

TokenPurpose
headerBgHeader background.
headerColorHeader text.
headerSortActiveBgSortable header background.
headerSortHoverBgHover sortable header.
bodySortBgBackground of the sorted column.
rowHoverBgHover lines.
rowSelectedBgSelected row.
rowSelectedHoverBgHover the selected row.
rowExpandedBgDetails background.
cellPaddingBlockVertical padding large.
cellPaddingInlineHorizontal padding large.
cellPaddingBlockMDVertical padding medium.
cellPaddingInlineMDHorizontal padding medium.
cellPaddingBlockSMVertical padding small.
cellPaddingInlineSMHorizontal padding small.
borderColorBorder color.
headerBorderRadiusCap radius.
footerBgfooter panel background.
footerColorfooter panel text.
cellFontSizeFont large.
cellFontSizeMDFont medium.
cellFontSizeSMFont small.
headerSplitColorHeader separator.
fixedHeaderSortActiveBgSorting of the sticky header.
headerFilterHoverBgHover filter.
filterDropdownMenuBgFilter menu background.
filterDropdownBgFilter panel background.
expandIconBgReveal background.
selectionColumnWidthWidth of the checkbox column.
stickyScrollBarBgSticky scrollbar background.
stickyScrollBarBorderRadiusSticky scrollbar corner radius.
expandIconMarginTopTop opening margin.
expandIconHalfInnerGeometry of the disclosure icon.
expandIconSizeOpening size.
expandIconScaleDisclosure scale.
headerIconColorHeader icons.
headerIconHoverColorHover header icons.
Common tokens of the current topic
TokenMeaning
colorBgContainer#ffffff
colorTextrgba(0,0,0,0.88)
colorTextHeadingrgba(0,0,0,0.88)
colorPrimary#2f54eb
colorBorderSecondary#f0f0f0
fontSize14
lineHeight1.5714285714285714
paddingSM12

FAQ

Why is rowKey actually required?

Without an explicit rowKey, record.key is read. Unique keys link selection, expansion, and the DOM; The index of the visible row is not suitable.

How does server mode work?

The application processes TableChange and passes the finished page, total and loading. Table does not load data.

Why can't the React onChange example be literally copied?

Svelte receives one TableChange object. The sort, filter, page, and selection states are on the Table; render columns receive record/index, expansion is controlled via expandable.

What does selecting all rows do?

The header checkbox selects available rows on the current page and preserves keys on other pages. The menu's Select all command applies to the entire filtered data set.

Why does the filter return to the first page?

After the filter, the previous page may be missing. Managed state allows the application to negotiate the page and the overall total.

How to add editing and hide columns?

Use render snippet and update dataSource for editing, column.hidden for hiding. The examples preserve stable row keys.

How does the theme affect pagination size?

A medium table uses small pagination by default. In the prefix example, page items are 24 px tall in the regular theme and 21 px in the compact theme. Changing the prefix within the same theme preserves the height of the items and the table.