Skip to content

Table - Export Data

Through the built-in export feature, you can export table data to CSV, JSON, TXT, XML, HTML, XLSX and other formats, supporting custom columns, formatted content, excluded columns and other advanced configurations.

Export Data

The most basic export method, export table data as a CSV file through the component instance method exportData().

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export Data

Export TXT Format

TXT format uses Tab-separated columns, which can be directly pasted into Excel.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export TXT

Export XML Format

Export standard XML structure, suitable for data exchange with other systems.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export XML

Export HTML Format

Export styled HTML table file, viewable directly in a browser.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export HTML

Export CSV Format

CSV export supports Include Index column, automatically adding BOM header to ensure correct Chinese display in Excel.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export CSV

Export JSON Format

JSON format export that preserves original data types.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export JSON

Export Excel Format

Export as .xlsx format Excel file, supporting Auto calculate column width, custom Sheet name and other advanced features.

Tip: Excel export relies on the xlsx library. Exported files can be opened directly with Microsoft Excel, WPS and other software.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Export Excel

Custom Data

Specify export data through the data parameter to implement filtered export.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Custom Data

Formatted Export Content

Customize cell export values through the formatCell callback function, such as adding currency symbols, status icons, etc.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Formatted Export

Advanced Export

Configure export format, filename, whether to include Index and header, and get export result through afterExport callback.

Format:Filename:
Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Advanced Export

Exclude Columns

Specify columns not to be exported through excludeColumns.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Exclude Columns

Specify Columns

Specify which columns to export through columns.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Specify Columns

Custom Column Titles

Use columnTitles to customize column titles when exporting, e.g., export English headers.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Custom Column Titles

Custom Export Type

Select export format through a dropdown menu.

Export Format:
Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Custom Export Type

Server-Side Export

For very large datasets or scenarios requiring XLSX/PDF format generation, server-side export is recommended.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Server-Side Export

Custom Export Mode

Setting mode: 'string' returns the export content string without triggering download, suitable for copying to clipboard or further processing.

Index
Name
Age
Department
Salary
Status
Address
1
John
28
Engineering
15000
Active
Chaoyang, Beijing
2
Jane
32
Product
18000
Active
Pudong, Shanghai
3
Mike
25
Design
14000
Inactive
Tianhe, Guangzhou
4
Sarah
35
Operations
22000
Active
Nanshan, Shenzhen
5
Tom W.
29
Marketing
16000
Active
Xihu, Hangzhou
Custom Export Mode

API

exportData(config?) Method

PropertyDescriptionTypeDefault
typeExport format'csv' | 'json' | 'txt' | 'xml' | 'html' | 'xlsx''csv'
filenameFilename (without extension)string'export'
includeHeaderWhether to include Headerbooleantrue
showIndexWhether to include Index columnbooleanfalse
indexTitleIndex column titlestring'No.'
columnsSpecify export columns (prop array)string[]All visible columns
excludeColumnsExclude columns (prop array)string[]
visibleOnlyWhether to export only visible columnsbooleantrue
dataCustom Export DataRecord<string, unknown>[]Current table data
columnTitlesCustom Column Titles mappingRecord<string, string>
formatCellFormat cell content(value, column, row) => string
separatorCSV separatorstring','
bomWhether to add BOM headerbooleantrue
modeExport mode'download' | 'string''download'
beforeExportBefore export callback() => boolean
afterExportAfter export callback(type) => void
sheetNameSheet name (XLSX only)string'Sheet1'
columnWidthsColumn width config (XLSX only), e.g. { name: 15, address: 30 }Record<string, number>
defaultColWidthDefault column width (XLSX only)number12
autoWidthWhether to auto-adjust column width (XLSX only)booleantrue

Format Descriptions

FormatExtensionMIMEFeatures
CSV.csvtext/csvUniversal format, Excel can open directly, auto BOM
JSON.jsonapplication/jsonPreserves original data types, suitable for inter-program exchange
TXT.txttext/plainTab-separated, can be pasted directly into Excel
XML.xmlapplication/xmlStandard XML structure, suitable for system integration
HTML.htmltext/htmlStyled table, viewable directly in browser
XLSX.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel format, supports auto column width, multiple sheets

Released under the MIT License.