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 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 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 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 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 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 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
xlsxlibrary. 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 |
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 |
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 |
Advanced Export
Configure export format, filename, whether to include Index and header, and get export result through afterExport callback.
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 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 |
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 |
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 Export Type
Select export format through a dropdown menu.
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
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 |
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 |
API
exportData(config?) Method
| Property | Description | Type | Default |
|---|---|---|---|
| type | Export format | 'csv' | 'json' | 'txt' | 'xml' | 'html' | 'xlsx' | 'csv' |
| filename | Filename (without extension) | string | 'export' |
| includeHeader | Whether to include Header | boolean | true |
| showIndex | Whether to include Index column | boolean | false |
| indexTitle | Index column title | string | 'No.' |
| columns | Specify export columns (prop array) | string[] | All visible columns |
| excludeColumns | Exclude columns (prop array) | string[] | — |
| visibleOnly | Whether to export only visible columns | boolean | true |
| data | Custom Export Data | Record<string, unknown>[] | Current table data |
| columnTitles | Custom Column Titles mapping | Record<string, string> | — |
| formatCell | Format cell content | (value, column, row) => string | — |
| separator | CSV separator | string | ',' |
| bom | Whether to add BOM header | boolean | true |
| mode | Export mode | 'download' | 'string' | 'download' |
| beforeExport | Before export callback | () => boolean | — |
| afterExport | After export callback | (type) => void | — |
| sheetName | Sheet name (XLSX only) | string | 'Sheet1' |
| columnWidths | Column width config (XLSX only), e.g. { name: 15, address: 30 } | Record<string, number> | — |
| defaultColWidth | Default column width (XLSX only) | number | 12 |
| autoWidth | Whether to auto-adjust column width (XLSX only) | boolean | true |
Format Descriptions
| Format | Extension | MIME | Features |
|---|---|---|---|
| CSV | .csv | text/csv | Universal format, Excel can open directly, auto BOM |
| JSON | .json | application/json | Preserves original data types, suitable for inter-program exchange |
| TXT | .txt | text/plain | Tab-separated, can be pasted directly into Excel |
| XML | .xml | application/xml | Standard XML structure, suitable for system integration |
| HTML | .html | text/html | Styled table, viewable directly in browser |
| XLSX | .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Excel format, supports auto column width, multiple sheets |