Table

The Table component is a powerful and flexible Vue.js component for displaying and managing tabular data. It supports sorting, filtering, grouping, pagination, inline editing, and extensive styling options.

Basic Usage

The Table component can be used with minimal configuration to display a dataset. At its core, it requires the data-source prop to provide the data to be rendered. By default, it automatically generates columns based on the keys of the objects in the data source.

1
John Doe
30
2
Jane Smith
25
3
Bob Johnson
45
<script setup lang="ts">
  const tableData = [
    { id: 1, name: 'John Doe', age: 30 },
    { id: 2, name: 'Jane Smith', age: 25 },
    { id: 3, name: 'Bob Johnson', age: 45 },
  ];
</script>
<template>
  <Table :data-source="tableData" />
</template>

In this example, the Table component renders a simple table using the tableData array. The data-source prop accepts an array of objects, where each object represents a row, and its keys (id, name, age) are used to automatically create columns. The component displays the data in a basic format with no additional configuration needed. This setup is ideal for quickly visualizing data without customization.

Column Configuration

The columns prop allows you to define the structure and behavior of each column in the Table component. It accepts an array of IColumn objects, where each object configures a single column.

dataField

The dataField property specifies the key in the data-source object that corresponds to this column's data. If not provided, the column may not display data unless inferred from the data source keys.

Name
Color
WeightGrams
Pineapple
Pink
1388
Banana
Green
919
Orange
Yellow
166
Peach
Pink
102
Grapes
Red
947
<template>
  <Table 
    :data-source="tableData" 
    :columns="[
      { dataField: 'name' }, 
      { dataField: 'color' }, 
      { dataField: 'weightGrams' }
    ]">
  </Table>
</template>

name

The name property provides an internal identifier for the column, useful for referencing in templates or logic.

<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', name: 'userName' }];
</script>

type

The type property specifies the data type of the column. This property determines the structure and behavior of the column, including how it handles filtering and editing.

"string" or "number"

When the type is set to "string" or "number", the column is configured to handle textual or numerical data respectively.

Name
Star rating
Rooms available
City Center Inn
1
86
Mountain Lodge
5
33
Skyline Hotel
5
104
Skyline Hotel
2
298
City Center Inn
3
23
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe', age: 30 }];
const columns = [
  { dataField: 'name', type: 'string' },
  { dataField: 'age', type: 'number', isFilter: true }
];
</script>

"select"

When the type is set to "select", the column is configured to handle dropdown selections.

Name
Country
Star rating
Mountain Lodge
Thailand
5
Mountain Lodge
Canada
4
City Center Inn
Thailand
4
Grand Palace
USA
1
Skyline Hotel
Japan
3
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, country: 'USA' }];
const columns = [{
  dataField: 'country',
  type: 'select',
  isFilter: true
}];
</script>

"date"

When the type is set to "date", the column is configured to handle date values.

Name
Created At
Updated At
Start Date
End Date
Exhibition
18.06.2023
29.11.2022
14.01.2023
02.12.2023
Meeting
19.05.2025
26.04.2023
22.04.2023
23.03.2023
Conference
25.09.2023
09.09.2024
23.08.2023
09.05.2023
Webinar
03.06.2023
15.06.2026
15.05.2023
28.06.2023
Sports Event
17.06.2024
10.11.2025
06.11.2023
24.07.2023
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, birthdate: '1990-01-01' }];
const columns = [{
  dataField: 'birthdate',
  type: 'date',
  isFilter: true
}];
</script>

caption

The caption property customizes the text displayed in the column header for better readability or localization. If not provided, it defaults to the capitalized dataField.

Name
Color
Weight (grams)
Banana
Green
69
Mango
Orange
1636
Grapes
Orange
555
Banana
Green
1184
Mango
Orange
480
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', caption: 'Full Name' }];
</script>

visible

The visible property controls whether the column is displayed, allowing you to hide or show the column without removing it from the configuration.

Visible
Name
Color
Peach
Orange
Watermelon
Pink
Orange
Green
Pineapple
Green
Mango
Pink
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'id', visible: false }, { dataField: 'name' }];
</script>

isFilter

The isFilter property enables filtering for the column, allowing users to filter data in this column.

Name
Color
Weight (grams)
Orange
Green
1788
Banana
Red
265
Strawberry
Green
748
Orange
Purple
267
Grapes
Orange
680
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', isFilter: true }];
</script>

isSort

The isSort property enables sorting for the column, allowing users to sort data by this column.

Name
Color
Weight (grams)
Grapes
Yellow
355
Mango
Green
1237
Strawberry
Yellow
1117
Peach
Purple
1469
Watermelon
Purple
1348
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', isSort: true }];
</script>

isResized

The isResized property enables manual resizing of the column by dragging, allowing users to adjust column width interactively.

Name
Color
Weight (grams)
Strawberry
Green
531
Grapes
Green
458
Kiwi
Orange
563
Kiwi
Orange
237
Banana
Pink
1668
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', isResized: true }];
</script>

width

The width property sets the initial width of the column in pixels, defining a fixed width for consistent layout.

Name
Color
Weight (grams)
Banana
Pink
5.77
Mango
Purple
3.18
Strawberry
Yellow
9.78
Apple
Purple
5.58
Orange
Yellow
9.85
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', width: 200 }];
</script>

minWidth

The minWidth property sets the minimum width of the column in pixels, ensuring the column doesn't shrink below a certain size, useful for resizing.

Name
Color
Weight (grams)
Peach
Pink
9.67
Kiwi
Yellow
7.89
Banana
Pink
3.67
Banana
Red
6.25
Peach
Red
2.42
<template>
  <Table :data-source="tableData" :columns="columns" is-resized />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', minWidth: 100 }];
</script>

maxWidth

The maxWidth property sets the maximum width of the column in pixels, limiting how wide the column can grow during resizing.

Name
Color
Weight (grams)
Watermelon
Purple
1.97
Banana
Yellow
8.61
Strawberry
Purple
2.51
Peach
Orange
7.01
Strawberry
Yellow
7.03
<template>
  <Table :data-source="tableData" :columns="columns" is-resized />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', maxWidth: 300 }];
</script>

defaultFilter

The defaultFilter property sets an initial filter value for the column, pre-applying a filter when the table loads.

Model
Color
Price (USD)
A4
Silver
26078
Corolla
Green
32914
A4
Red
29487
Civic
Blue
27361
Civic
Green
18960
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }, { id: 2, name: 'Jane Smith' }];
const columns = [{ dataField: 'name', isFilter: true, defaultFilter: 'John' }];
</script>

defaultSort

The defaultSort property sets the initial sort order for the column, pre-sorting the table by this column on load.

Model
Color
Price (USD)
A4
Blue
6734
Model S
Black
7792
EV6
Black
24667
X5
Blue
95271
Corolla
Green
46188
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }];
const columns = [{ dataField: 'name', isSort: true, defaultSort: 'asc' }];
</script>

mask

The mask property applies an input mask to the column's values for display or editing, formatting values (e.g., phone numbers, prices) consistently.

Model
Mileage (km)
Price (USD)
Corolla
48 303
40 991
A4
29 362
35 327
Mustang
138 362
77 076
X5
137 775
16 463
EV6
82 970
37 121
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, price: 1234.56 }];
const columns = [{ dataField: 'price', mask: 'price' }];
</script>

cellTemplate

The cellTemplate property specifies a slot name for custom rendering of cell content, allowing custom HTML or components for cell display.

Name
Country
Recommended
Star rating
City Center Inn
Thailand
no
Ocean View
Thailand
yes
Grand Palace
Thailand
no
Mountain Lodge
Thailand
no
Skyline Hotel
Italy
yes
<template>
  <Table :data-source="tableData" :columns="columns">
    <template #customName="{ value }">
      <strong>{{ value }}</strong>
    </template>
  </Table>
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{ dataField: 'name', cellTemplate: 'customName' }];
</script>

setCellValue

The setCellValue property allows you to define a function to customize how cell values are formatted or computed, overriding default value rendering for complex logic.

Model
Year
Mileage (km)
Price (USD)
A4
2010 year
193043 km
$ 49640
EV6
2022 year
161851 km
$ 6576
Civic
2006 year
171206 km
$ 86768
Model S
2000 year
66144 km
$ 45223
Civic
2016 year
165569 km
$ 78946
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, age: 30 }];
const columns = [{
  dataField: 'age',
  setCellValue: (column, value) => `${value} years`
}];
</script>

paramsFilter

The paramsFilter property allows you to provide partial options for filtering based on the data type specified in the type property. Depending on the type, you can customize the filter's behavior and appearance using the appropriate properties.

  • For "string" or "number" types: Use options specific to input fields.
  • For "select" type: Use options specific to select fields.
  • For "date" type: Use options specific to date fields.

Refer to the relevant documentation for more details:

Input Field Properties

For filtering options when using input fields ("string" or "number" types), explore the Input Field properties.

Select Field Properties

For filtering options when using select fields ("select" type), explore the Select Field properties.

Date Field Properties

For filtering options when using date fields ("date" type), explore the Date Field properties.

class

The class property allows you to apply custom CSS classes for various parts of the column, including the header, filter, and cell content.

Column Class Properties

Explore the various properties available for customizing the CSS classes of table columns, including header cells, filter inputs, and data cells. Dive into each property to see how you can style different parts of the column effectively.

Working with Data

Configure table functionality such as toolbar, sorting, filtering, search, and grouping for efficient data management.

Toolbar Table

The toolbar property configures the toolbar for the table. It can be enabled/disabled or customized using an object with specific options.

Name table
Name
Color
Weight (grams)
Banana
Green
1677
Mango
Green
634
Pineapple
Green
84
Pineapple
Orange
484
Pineapple
Green
157
<Table
    :data-source="tableData"
    :toolbar="{ visible: true }">
</Table>
  • visible: Determines whether the toolbar is displayed.
  • search: Enables the search input in the toolbar.

By setting toolbar to true, the toolbar is enabled with default settings. Providing an object allows for detailed customization.

Sorting

The sort property enables and configures sorting for the table. You can activate it with default behavior or customize its appearance and functionality.

Name
Color
Weight (grams)
Strawberry
Pink
415
Peach
Orange
1344
Banana
Pink
831
Apple
Orange
1767
Mango
Pink
624
<Table
    :data-source="tableData"
    :sort="{ 
        visible: true, 
        icon: 'Bars' 
    }">
</Table>
  • visible: Toggles the visibility of the sorting feature.
  • icon: Specifies the sorting icon style ("Bars" or "Arrow").

Set sort to true for default sorting or provide an object for more control.

Filtering

The filter property enables row filtering in the table. It can be toggled or configured with advanced options.

Find...
Name
Color
Weight (grams)
Grapes
Pink
1569
Kiwi
Purple
422
Kiwi
Red
1344
Pineapple
Red
220
Watermelon
Red
1412
<Table 
    :data-source="tableData" 
    :filter="{ 
        visible: true, 
        noFilter: 'No filters applied', 
        isClearAllFilter: true 
    }">
</Table>
  • visible: Toggles the filtering feature.
  • noFilter: Message displayed when no filters are applied.
  • isClearAllFilter: Enables a "Clear All Filters" option.

Setting filter to true activates basic filtering, while providing an object allows for advanced configurations.

The search property enables global search functionality across the table data.

Find...
Name
Color
Weight (grams)
Banana
Red
400
Watermelon
Yellow
1202
Strawberry
Yellow
1802
Orange
Yellow
769
Banana
Purple
1198
<Table 
    :data-source="tableData"
    :search="true">
</Table>

Set search to true to allow users to search through the entire table content.

Grouping

The grouping property enables data grouping in the table. You can specify the grouping field or provide a configuration object.

Name
Color
Weight (grams)
Red
Orange
Red
739
Strawberry
Red
1737
Kiwi
Red
1806
Pink
Apple
Pink
1399
Strawberry
Pink
655
<Table 
    :data-source="tableData" 
    :grouping="{ visible: true, groupField: 'category' }">
</Table>
  • visible: Toggles the grouping feature.
  • groupField: Specifies the field used for grouping.

Setting grouping to a field name (e.g., "category") groups rows by that field. Using an object provides further customization.

Count visible rows

The countVisibleRows property specifies the number of rows visible in the table. This is useful for limiting the number of rows displayed at once.

5
Visible rows
Banana
Red
262
true
Brazil
8.68
Peach
Purple
1286
true
Thailand
1.50
Grapes
Orange
907
false
Brazil
2.64
Kiwi
Green
447
true
Thailand
6.18
Watermelon
Red
1378
false
Brazil
3.56
<Table 
    :data-source="tableData" 
    :countVisibleRows="10">
</Table>

Set countVisibleRows to the desired number to control how many rows are visible at a time.

Resized columns

The resizedColumns property enables or disables column resizing in the table. When enabled, users can adjust the width of columns by dragging them.

Name
Color
Weight (grams)
Mango
Orange
1074
Apple
Yellow
1723
Grapes
Purple
759
Strawberry
Red
1263
Peach
Purple
375
<Table 
    :data-source="tableData" 
    :resizedColumns="true">
</Table>

Set resizedColumns to true to allow column resizing.

countDataOnLoading

The countDataOnLoading property specifies the threshold at which the data loading indicator is triggered. This is particularly useful for improving the user experience during operations like search or filtering when working with large datasets.

Predefined values include 100, 1000, and 10000.

Find...
Name
Color
Weight (grams)
Peach
Yellow
925
Watermelon
Yellow
1307
Watermelon
Green
1292
Watermelon
Green
209
Grapes
Purple
1089
<Table
    :search="true"
    :data-source="tableData" 
    :countDataOnLoading="1000">
</Table>

Set countDataOnLoading to define the number of rows at which the loading indicator should appear. For example, during search or filtering, if the dataset exceeds this threshold, a loading state will be shown to enhance the user experience.

Summary

The summary property allows you to define and display summary rows in the table. This feature enables you to perform calculations (e.g., sum, min, max) on specified fields and customize how the results are displayed.

dataField

The dataField property specifies the data field for which the summary is calculated.

Banana
Orange
66
Strawberry
Yellow
1531
Peach
Pink
1399
Mango
Purple
557
Mango
Pink
1497
Кол. 5
Кол. 5
Кол. 5
<Table 
    :data-source="tableData" 
    :summary="{ dataField: 'price' }">
</Table>

By setting dataField, you define the column that will be used for summary calculations.

name

The name property provides a custom name for the summary. This is helpful when displaying multiple summaries.

<Table
    :data-source="tableData"
    :summary="{ 
        dataField: 'price', 
        name: 'totalPrice' 
    }">
</Table>

Set name to give a meaningful label to your summary.

dataType

The dataType property specifies the data type for the summary. It ensures that the summary values are formatted correctly based on their type. The available options are:

  • "string": For textual data.
  • "number": For numerical data.
  • "select": For dropdown or selection-based data.
  • "date": For date-based data.
<Table
    :data-source="tableData"
    :summary="{ 
        dataField: 'price',  
        dataType: 'number' 
    }">
</Table>

Set dataType to match the type of data in the specified dataField. For instance, use "number" for numeric values or "date" for date-based fields.

type

The type property specifies the type of calculation performed for the summary. The available options are:

  • "sum": Calculates the total of all values.
  • "min": Finds the minimum value.
  • "max": Finds the maximum value.
  • "avg": Calculates the average of all values.
  • "count": Counts the number of rows.
Name
Total Users
Total Revenue
Active Users
New Users Today
Yearly Overview
9353
443917
13064
509
Monthly Report
94556
389941
2007
475
Weekly Summary
71095
768379
41893
436
Weekly Summary
69511
225232
16556
700
Daily Statistics
22181
628378
35899
677
Count: 5
Avg: 53339
Min: 225232
Max: 41893
Sum: 2797
<Table 
    :data-source="tableData" 
    :summary="{ 
        dataField: 'price',
        dataType: 'number',
        type: 'sum' 
    }">
</Table>

Use type to configure the calculation logic for the summary.

displayFormat

The displayFormat property allows you to specify a custom format for displaying the summary result. You can use placeholders such as {0} to represent the calculated value.

Predefined formats include:

  • "Sum: {0}" : Calculates the total of all values.
  • "Min: {0}" : Finds the minimum value.
  • "Max: {0}" : Finds the maximum value.
  • "Avg: {0}" : Calculates the average of all values.
  • "Count: {0}": Counts the number of rows.
Name
Total Users
Total Revenue
Active Users
New Users Today
Daily Statistics
69677
292199
43500
506
Yearly Overview
53480
28630
49175
952
Yearly Overview
33587
133567
24753
222
Weekly Summary
22352
316981
2944
205
Quarterly Analysis
3687
911493
30227
891
Name: 5 (count)
Total Users: 36557 (avg)
Total Revenue: 28630 (min)
Active Users: 49175 (max)
New Users Today: 2776 (sum)
<Table
    :data-source="tableData"
    :summary="{ 
        dataField: 'price', 
        type: 'sum', 
        displayFormat: 'Total: {0}' 
    }">
</Table>

Use displayFormat to customize how the summary result appears in the table.

customizeText

The customizeText property provides a function for dynamically customizing the summary text. This function receives the summary configuration and the calculated result as parameters and returns the formatted text.

<Table 
  :data-source="tableData" 
  :summary="{ 
    dataField: 'price', 
    type: 'sum', 
    customizeText: (summary, result) => `Total: ${result}` 
  }">
</Table>

Use customizeText for advanced text formatting based on the calculated summary value.

Pagination

The pagination property allows you to configure how table data is split into pages and how pagination controls are displayed.

visible

The visible property determines whether the pagination controls are displayed. The pagination property itself can be used in two ways:

  1. Boolean Shortcut: If set to true, pagination is enabled with default settings.
  2. Detailed Configuration: By providing an object, you can customize the pagination behavior.
Visible
Kiwi
Pink
1202
true
Mexico
4.38
Watermelon
Orange
560
true
Mexico
2.98
Orange
Red
830
false
USA
2.22
Kiwi
Orange
1332
true
China
1.51
Banana
Yellow
1022
true
Thailand
8.41
1/100
<Table :data-source="tableData" pagination></Table>

This enables pagination with the default configuration.

Visible
Banana
Orange
1853
false
Thailand
6.00
Pineapple
Green
155
false
Thailand
7.35
Grapes
Green
743
false
India
5.28
Grapes
Yellow
1664
true
Mexico
4.36
Mango
Purple
896
false
Thailand
3.27
1/100
<Table
    :data-source="tableData"
    :pagination="{ visible: true }">
</Table>

By using an object, you can explicitly configure pagination options such as visibility, page size, and more.

Setting visible to true ensures that pagination controls are displayed, while false hides them.

mode

The mode property specifies the styling mode of the pagination controls. Available options are:

  • "filled": Default filled style.
  • "outlined": Outlined style.
  • "underlined": Underlined style.
Mode
Banana
Red
312
true
Mexico
2.36
Strawberry
Pink
760
true
USA
5.50
Pineapple
Purple
786
true
Spain
6.01
Mango
Green
1907
false
Mexico
7.12
Banana
Pink
1258
false
India
0.47
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        mode: 'outlined' 
    }">
</Table>

Set mode to customize the appearance of pagination controls.

startPage

The startPage property sets the initial page to display when the table is rendered.

Apple
Purple
288
false
Mexico
8.80
Peach
Pink
1558
false
Brazil
3.34
Banana
Red
1241
false
Mexico
3.37
Strawberry
Yellow
1937
true
Thailand
1.52
Apple
Purple
1367
true
Brazil
1.37
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        startPage: 2 
    }">
</Table>

Use startPage to set the default page number.

sizePage

The sizePage property determines the number of items displayed per page. Predefined values include 5, 15, 20, 50, 100, and 150.

Size Page
Watermelon
Green
1584
true
Brazil
9.56
Kiwi
Orange
1445
true
Thailand
1.16
Peach
Yellow
1999
true
Spain
5.24
Pineapple
Green
331
false
Brazil
1.32
Strawberry
Pink
68
false
China
5.54
1/25
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        sizePage: 20 
    }">
</Table>

Set sizePage to control the number of rows displayed per page.

sizesSelector

The sizesSelector property defines the available page size options that users can select.

Mango
Yellow
1020
true
Spain
4.15
Banana
Purple
1355
true
USA
1.48
Apple
Green
301
true
USA
8.74
Apple
Pink
362
false
China
4.33
Mango
Purple
423
true
India
8.73
1/50
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        sizesSelector: [10, 25, 50] 
    }">
</Table>

Set sizesSelector to provide a custom list of page size options.

visibleNumberPages

The visibleNumberPages property specifies how many page numbers are displayed in the pagination control. The allowed values are 5, 6, 7, 8, 9, 10, or 11.

Apple
Pink
1177
true
Spain
2.43
Watermelon
Yellow
399
false
Mexico
2.44
Strawberry
Orange
594
true
Thailand
7.18
Orange
Green
518
false
China
6.46
Pineapple
Green
1502
false
India
3.31
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        visibleNumberPages: 7 
    }">
</Table>

Set visibleNumberPages to control the number of visible page buttons.

isInfoText

The isInfoText property enables informational text about the pagination state, such as "Page 1 of 5."

Pineapple
Red
909
false
Mexico
8.66
Kiwi
Green
481
true
Mexico
6.17
Orange
Green
896
true
Brazil
7.07
Mango
Yellow
1249
true
China
7.80
Peach
Purple
1911
false
India
9.66
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        isInfoText: true 
    }">
</Table>

Set isInfoText to true to display informative pagination text.

isPageSizeSelector

The isPageSizeSelector property enables a dropdown for selecting the page size.

Strawberry
Green
1796
true
Mexico
4.35
Strawberry
Red
590
true
Thailand
9.74
Pineapple
Purple
500
false
India
7.45
Watermelon
Purple
289
true
China
6.65
Orange
Purple
352
true
Mexico
5.68
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        isPageSizeSelector: true 
    }">
</Table>

Set isPageSizeSelector to true to allow users to select the number of rows per page.

isHiddenNavigationButtons

The isHiddenNavigationButtons property hides the pagination navigation buttons (e.g., "Next" and "Previous") when set to true.

Banana
Green
395
true
USA
2.32
Pineapple
Red
331
true
India
3.86
Strawberry
Red
622
false
Thailand
4.47
Grapes
Orange
1395
true
Spain
1.69
Kiwi
Yellow
254
true
Mexico
9.42
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        isHiddenNavigationButtons: true 
    }">
</Table>

Set isHiddenNavigationButtons to true to hide navigation buttons.

class

The class property allows you to apply custom CSS classes to the pagination controls for styling.

Orange
Orange
510
false
Thailand
1.94
Peach
Red
1466
true
USA
4.82
Grapes
Green
1505
true
Spain
8.59
Grapes
Green
1689
false
Brazil
6.55
Apple
Red
794
false
China
0.56
1/100
<Table
    :data-source="tableData"
    :pagination="{ 
        visible: true, 
        class: 'custom-pagination-class' 
    }">
</Table>

Set class to style the pagination controls with your custom CSS classes.

Slots

Slots are customizable sections of the table that allow you to inject your own content. The table provides predefined slots such as toolbar, header, footer, and group. Additionally, dynamic slots can be created for custom content.

#toolbar

The #toolbar slot allows you to customize the toolbar section of the table. This is useful for adding custom buttons, filters, or additional controls.

Name table
Name
Color
Weight (grams)
Grapes
Red
430
Grapes
Yellow
1415
Pineapple
Orange
1139
Peach
Orange
1787
Strawberry
Green
1319
<Table
    :data-source="tableData"
    :toolbar="{ visible: true }">
  <template #toolbar>
    <button @click="addRow">Add Row</button>
  </template>
</Table>

Note: To display the toolbar, the visible property must be explicitly set to true in the toolbar configuration.

By using the #toolbar slot, you can inject custom content into the toolbar area while ensuring it is visible by setting visible: true.

The #header slot enables you to customize the header of the table. You can modify the appearance of column headers or add additional elements.

Name table
Name
Color
Weight (grams)
Pineapple
Green
1223
Orange
Pink
1784
Orange
Yellow
1686
Mango
Pink
1850
Peach
Red
447
<Table :data-source="tableData">
  <template #header>
    <div class="custom-header">My Custom Header</div>
  </template>
</Table>

Use the #header slot to replace or enhance the default table header.

#group

The #group slot is used to customize the appearance of grouped rows. This is especially useful when you want to add custom visuals or formatting to grouped data.

  • item: The grouped item.
  • length: The total number of grouped items.
Name
Color
Weight (grams)
Green
Banana
Green
594
Mango
Green
1334
Pineapple
Green
191
Grapes
Green
1241
Pineapple
Green
1566
<Table :data-source="groupedData">
  <template #group="{ item, length }">
    <div class="custom-group">
      {{ item }} ({{ length }} items)
    </div>
  </template>
</Table>

Use the #group slot to define how grouped rows should be displayed.

The #footer slot allows you to customize the footer section of the table. This is useful for adding summaries, pagination controls, or other custom elements.

Name
Color
Weight (grams)
Banana
Orange
1667
Banana
Yellow
351
Strawberry
Red
1938
Kiwi
Pink
1015
Peach
Red
1606
<Table :data-source="tableData">
  <template #footer>
    <div>Total Rows: {{ tableData.length }}</div>
  </template>
</Table>

Use the #footer slot to add content or functionality to the table footer.

Dynamic Slots

In addition to the predefined slots, dynamic slots allow you to customize content for specific table cells or components dynamically. Dynamic slots use keys to target specific columns or rows.

The following arguments are passed to dynamic slots:

  • name: The name of the slot.
  • key: The key of the column or row.
  • column: The column configuration object.
  • rowData: The data for the current row.
  • value: The value of the cell.
  • valueWithMarker: The value of the cell with any markers applied.
  • isCloseEditor: A function to control whether the cell editor should close.
  • editValue: A function to edit the cell's value.
Name
Color
Weight (grams)
Strawberry
Purple
1776
Watermelon
Red
1547
Mango
Orange
721
Strawberry
Green
1503
Apple
Pink
317
<Table :data-source="tableData">
  <template #customSlot="{ value }">
    <div class="custom-cell">
      {{ value }}
    </div>
  </template>
</Table>

Dynamic slots provide flexibility for customizing individual cells or rows based on the provided arguments.

Styles

This section provides options for customizing the appearance and styling of the table. You can control styling modes, apply custom CSS classes, and configure detailed style properties.

mode

The mode property specifies the overall styling mode of the table. The available options are:

  • "filled": A solid-filled table style.
  • "outlined": A table with outlined borders.
  • "underlined": A table with underlined rows or columns.
Mode
Orange
Yellow
600
Banana
Red
282
Watermelon
Red
919
Watermelon
Purple
1022
Kiwi
Yellow
1696
<Table
    :columns="true" 
    :summary="true" 
    :filter="true"
    :data-source="tableData" 
    :mode="'outlined'">
</Table>

Set mode to define the overall look and feel of the table.

noData

The noData property specifies the message to display when there is no data available in the table.

No data available at the moment.
<Table 
    :data-source="[]" 
    :noData="'No data available at the moment.'">
</Table>

In this example, the message "No data available at the moment." will be shown when the data source is empty.

noColumn

The noColumn property specifies the message to display when no columns are defined in the table.

No columns defined for the table.
<Table 
    :data-source="[{}]" 
    :noColumn="'No columns defined for the table.'">
</Table>

Here, the message "No columns defined for the table." will be displayed when no column configurations are provided.

class

The class property allows you to apply custom CSS classes to the table container for additional styling.

Apple
Pink
1146
Watermelon
Orange
1164
Strawberry
Red
183
Grapes
Red
1611
Mango
Purple
876
<Table 
    :data-source="tableData" 
    :class="'custom-table-class'">
</Table>

Use class to apply custom styles like padding, colors, or borders to the table container.

styles

The styles property provides a comprehensive way to configure the appearance of the table. Below are examples showcasing different configurations of the styles property.

Custom class and border

You can define custom CSS classes and border styles for the table.

Table zones
Table border
Toolbar
Find...
Header
Green
Watermelon
Green
1056
Pineapple
Green
1264
Kiwi
Green
586
Watermelon
Green
1975
Mango
Green
500
Footer
<Table 
    :data-source="tableData" 
    :styles="{
        class: 'custom-table-class',
        border: 'custom-table-border'
    }">
</Table>

In this example, a custom CSS class is applied, and only the bottom border is displayed.

Custom width and height

You can configure the table's width and height to fit your layout.

Width
Height
Find...
Pink
Apple
Pink
1493
Banana
Pink
149
Grapes
Pink
1010
Grapes
Pink
842
Mango
Pink
1950
1/3
<Table 
    :data-source="tableData" 
    :styles="{
        width: '100%',
        height: '500px'
    }">
</Table>

This example sets the table to occupy 100% of the container's width and a fixed height of 500 pixels.

hoverRows and isStripedRows

Enable hover effects and striped rows for better row visualization.

Hover selection
Alternating lines
Apple
Yellow
1190
Strawberry
Orange
1112
Peach
Green
395
Banana
Yellow
1982
Grapes
Yellow
288
<Table 
    :data-source="tableData" 
    :styles="{
        hoverRows: true,
        isStripedRows: true
    }">
</Table>

Here, rows change appearance on hover, and alternating row stripes are enabled.

horizontalLines, verticalLines, and filterLines

Control the display of horizontal and vertical lines, and enable or disable filter lines.

Horizontal Lines
Vertical Lines
Filter Lines
Peach
Orange
1662
Kiwi
Yellow
1511
Pineapple
Orange
1007
Apple
Pink
1087
Grapes
Orange
765
<Table 
    :data-source="tableData" 
    :styles="{
        horizontalLines: true,
        verticalLines: true,
        filterLines: true
    }">
</Table>

This example ensures that both row and column dividers are visible, and filter lines are displayed.

borderRadiusPx and heightCell

Adjust the border radius and the height of table cells for a more customized design.

Border Radius (px)
Cell Height
Pineapple
Purple
981
Banana
Green
773
Grapes
Red
502
Pineapple
Red
986
Watermelon
Red
1132
<Table 
    :data-source="tableData" 
    :styles="{
        borderRadiusPx: 10,
        heightCell: 50
    }">
</Table>

In this example, the table has rounded corners (10px radius), and each row is 50 pixels high.

Styles Overview

The styles property provides a flexible and comprehensive way to customize the appearance of your table. You can define everything from dimensions, hover effects, and row styling to animations, borders, and text formatting. This allows for a highly tailored design that aligns with the visual requirements of your application.

  • class: CSS class styles for various parts of the table.
  • width: The width of the table (e.g., "100%", "800px").
  • height: The height of the table (e.g., "500px").
  • hoverRows: Styles applied when hovering over rows (e.g., "hover:bg-neutral-100/90").
  • isStripedRows: Enable or disable striped row styling.
  • horizontalLines: Show or hide horizontal lines between rows.
  • verticalLines: Show or hide vertical lines between columns.
  • filterLines: Display filter lines.
  • borderRadiusPx: Border radius for the table (in pixels).
  • heightCell: Height of table cells (in pixels).
  • defaultWidthColumn: Default column width (e.g., "max-width: 600px;min-width:100px;width:auto").
  • maskQuery: Query text styling (e.g., "font-bold text-theme-700 dark:text-theme-300").
  • animation: Animation styles like "transition-all duration-500" or "transition-none".
  • border: Border styles for the table (e.g., "border-0" or "border-t-0 border-b-0").

Use the styles property to define a detailed and cohesive appearance for your table, covering all aspects from dimensions to hover effects.

Column styling

The class property allows you to apply custom CSS classes for various parts of the column, including the header, filter, and cell content.

th

Apply a custom CSS class to the header cell (th). This allows you to customize the appearance of the table header cells according to your design needs.

Name
Color
Weight (grams)
Apple
Pink
754
Orange
Purple
1013
Apple
Green
1736
Pineapple
Green
1209
Peach
Green
1927
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { th: 'class-th' }
}];
</script>

colFilter

The colFilter property allows you to apply a custom CSS class to the column filter input, enabling you to style the filter input elements.

Name
Color
Weight (grams)
Apple
Green
159
Banana
Yellow
191
Mango
Red
432
Peach
Red
1510
Mango
Orange
1279
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { colFilter: 'class-col-filter' }
}];
</script>

colFilterClass

Use the colFilterClass property to apply a custom CSS class to the column filter container, allowing for precise styling of the filter container.

Name
Color
Weight (grams)
Apple
Red
1127
Peach
Green
375
Mango
Purple
515
Orange
Purple
554
Kiwi
Green
326
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { colFilterClass: 'class-col-filter-container' }
}];
</script>

colFilterClassBody

The colFilterClassBody property allows you to apply a custom CSS class to the column filter body, providing additional control over the styling of the filter body.

Name
Color
Weight (grams)
Kiwi
Red
777
Kiwi
Pink
1163
Grapes
Orange
1919
Strawberry
Green
569
Kiwi
Purple
58
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { colFilterClassBody: 'class-col-filter-body' }
}];
</script>

colText

Use the colText property to apply a custom CSS class to the text content in the column header. This property helps in adjusting the text style within the header cells.

Name
Color
Weight (grams)
Kiwi
Orange
1482
Mango
Orange
1766
Pineapple
Red
630
Watermelon
Pink
551
Strawberry
Orange
860
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { colText: 'class-col-text' }
}];
</script>

td

Apply a custom CSS class to the table data cells (td). This property allows you to customize the appearance of the table data cells.

Name
Color
Weight (grams)
Kiwi
Orange
1189
Peach
Purple
98
Orange
Green
1508
Pineapple
Yellow
998
Peach
Orange
1932
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { td: 'class-td' }
}];
</script>

cellText

The cellText property allows you to apply a custom CSS class to the text content within the cells. This provides control over the styling of the cell text.

Name
Color
Weight (grams)
Strawberry
Pink
318
Pineapple
Orange
1431
Kiwi
Yellow
1441
Pineapple
Pink
847
Banana
Purple
462
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { cellText: 'class-cell-text' }
}];
</script>

tf

The tf property allows you to apply a custom CSS class to the footer cell (tf). This is useful for customizing the appearance of the footer cells.

Name
Color
Weight (grams)
Watermelon
Yellow
1573
Orange
Pink
1813
Watermelon
Orange
1997
Mango
Pink
91
Pineapple
Orange
1532
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
const tableData = [{ id: 1, name: 'John Doe' }];
const columns = [{
  dataField: 'name',
  class: { tf: 'class-tf' }
}];
</script>

sumText

Use the sumText property to apply a custom CSS class to the summary text in the footer. This property helps in adjusting the style of the summary text within the footer cells.

Name
Color
Weight (grams)
Mango
Red
340
Peach
Green
1742
Pineapple
Green
439
Banana
Green
371
Pineapple
Red
1097
<template>
  <Table :data-source="tableData" :columns="columns" />
</template>

<script setup lang="ts">
  const tableData = [{ id: 1, name: 'John Doe' }];
  const columns = [{
    dataField: 'name',
    class: { sumText: 'class-sum-text' }
  }];
</script>

Edit

The table supports editing functionality, which allows you to add, update, and delete rows of data. This feature can be enabled for the entire table or configured at the column level for greater flexibility.

Enabling Editing Mode

To enable editing for the entire table, use the :edit property and set it to true:

Name
Role
Created At
Updated At
Alice
admin
28.08.2022
19.06.2023
Judy
guest
02.04.2025
10.08.2023
Frank
admin
14.11.2025
30.10.2023
Grace
user
13.05.2026
30.12.2022
Grace
guest
09.11.2023
11.12.2023
<Table 
    :data-source="tableData" 
    :edit="true">
</Table>

This enables editing for all columns in the table.

Column-Level Editing

You can enable or disable editing for specific columns by using the edit option within the column configuration. This allows you to customize which columns can be edited.

Name
Age
Role
Alice
admin
Judy
guest
Frank
admin
Grace
user
Grace
guest
<Table 
    :columns="[
        { name: 'name', edit: false }, // Editing disabled for this column
        { name: 'age', edit: true },
        { name: 'role', edit: true }
    ]"
    :data-source="tableData">
</Table>

In this example, editing is enabled for the id and name columns but disabled for the age column.

<Table 
    :edit="true" 
    :columns="[
        { name: 'id', edit: false }, // Editing disabled for this column
        { name: 'name', edit: true }, // Editing remains enabled
    ]"
    :data-source="tableData">
</Table>

This combination enables editing for the entire table but excludes specific columns from being editable.

Configuring Cell Editors

The table provides the ability to customize the editor for each cell based on the column's data type. This is achieved using the edit option within the column configuration:

Column Editor Options

columns: [
  {
    name: 'exampleColumn',
    type: 'string' | 'number' | 'select' | 'date', // Data type for the column
    edit: {
      isEdit?: boolean, // Additional flag to enable or disable editing
      editorOptions?: Partial<BaseInputProps> | Partial<BaseSelectProps> | Partial<BaseCalendarProps> // Editor configuration
    }
  }
]
  • type: Defines the type of data in the column ("string", "number", "select", or "date").
  • editorOptions: Specifies additional configuration for the editor based on the type of data.

Refer to the relevant documentation for more details:

Input Field Properties

For configuration options when using input fields ("string" or "number" types`), explore the Input Field properties.

Select Field Properties

For configuration options when using select fields ("select" type), explore the Select Field properties.

Date Field Properties

For configuration options when using date fields ("date" type), explore the Date Field properties.

Data Editing

The table provides a set of methods to dynamically edit, manipulate, and interact with its data. These methods are accessible through the refLink of the table and allow for functionality such as adding, updating, deleting rows, and more.

For a complete list of available methods and their usage, refer to the Table API documentation.

Table API Documentation

Explore all the available methods for table editing, including addRow, deleteRow, updateRow, and more, in the Table API documentation.

© 2025 FishtVue by Egoka