Table
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 |
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 |
|---|---|---|
Strawberry | Red | 859 |
Mango | Purple | 1481 |
Peach | Yellow | 949 |
Mango | Orange | 1256 |
Grapes | Orange | 827 |
name
The name property provides an internal identifier for the column, useful for referencing in templates or logic.
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 |
|---|---|---|
Grand Palace | 5 | 53 |
Ocean View | 3 | 16 |
Skyline Hotel | 4 | 225 |
City Center Inn | 1 | 166 |
Ocean View | 4 | 92 |
"select"
When the type is set to "select", the column is configured to handle dropdown selections.
Name | Country | Star rating |
|---|---|---|
Skyline Hotel | Germany | 4 |
City Center Inn | Canada | 1 |
Skyline Hotel | Thailand | 3 |
Mountain Lodge | Italy | 1 |
Skyline Hotel | Canada | 1 |
"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 |
|---|---|---|---|---|
Concert | 14.11.2022 | 18.04.2024 | 30.04.2023 | 14.12.2023 |
Workshop | 29.11.2024 | 22.11.2022 | 02.09.2023 | 08.12.2023 |
Concert | 09.06.2022 | 03.03.2023 | 13.02.2023 | 25.03.2023 |
Exhibition | 12.04.2023 | 31.12.2023 | 19.05.2023 | 17.02.2023 |
Conference | 15.03.2024 | 25.03.2025 | 29.01.2023 | 21.05.2023 |
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) |
|---|---|---|
Mango | Orange | 191 |
Pineapple | Yellow | 355 |
Banana | Red | 699 |
Grapes | Red | 1255 |
Grapes | Pink | 1957 |
visible
The visible property controls whether the column is displayed, allowing you to hide or show the column without removing it from the configuration.
Name | Color |
|---|---|
Kiwi | Red |
Pineapple | Green |
Strawberry | Pink |
Mango | Green |
Peach | Pink |
isFilter
The isFilter property enables filtering for the column, allowing users to filter data in this column.
Name | Color | Weight (grams) |
|---|---|---|
Watermelon | Orange | 1150 |
Grapes | Purple | 768 |
Mango | Green | 1808 |
Orange | Pink | 289 |
Watermelon | Orange | 544 |
isSort
The isSort property enables sorting for the column, allowing users to sort data by this column.
Name | Color | Weight (grams) |
|---|---|---|
Pineapple | Yellow | 357 |
Mango | Orange | 1211 |
Pineapple | Green | 1544 |
Apple | Green | 1075 |
Watermelon | Pink | 1850 |
isResized
The isResized property enables manual resizing of the column by dragging, allowing users to adjust column width interactively.
Name | Color | Weight (grams) |
|---|---|---|
Kiwi | Purple | 185 |
Mango | Purple | 264 |
Orange | Yellow | 767 |
Pineapple | Purple | 1429 |
Mango | Purple | 426 |
width
The width property sets the initial width of the column in pixels, defining a fixed width for consistent layout.
Name | Color | Weight (grams) |
|---|---|---|
Grapes | Yellow | 9.81 |
Orange | Red | 6.06 |
Orange | Red | 6.50 |
Pineapple | Yellow | 6.75 |
Strawberry | Green | 7.50 |
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) |
|---|---|---|
Kiwi | Purple | 4.71 |
Orange | Purple | 9.12 |
Mango | Purple | 4.37 |
Grapes | Yellow | 9.91 |
Pineapple | Orange | 6.60 |
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) |
|---|---|---|
Apple | Green | 5.20 |
Peach | Purple | 4.15 |
Pineapple | Red | 1.92 |
Strawberry | Yellow | 5.22 |
Pineapple | Red | 2.92 |
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 | Red | 75619 |
Camry | Silver | 84077 |
Camry | Blue | 80961 |
EV6 | Black | 23109 |
Civic | Blue | 79746 |
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) |
|---|---|---|
Camry | Green | 76607 |
EV6 | Silver | 62064 |
X5 | Red | 91237 |
X5 | Silver | 5676 |
X5 | Green | 26019 |
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 | 155 480 | 84 280 |
X5 | 100 049 | 38 633 |
Model S | 182 087 | 16 657 |
A4 | 93 071 | 96 263 |
EV6 | 154 778 | 56 973 |
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 |
|---|---|---|---|
Skyline Hotel | USA | yes | |
City Center Inn | Canada | no | |
City Center Inn | Italy | no | |
Ocean View | Japan | no | |
Ocean View | Canada | no |
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) |
|---|---|---|---|
Corolla | 2018 year | 181607 km | $ 56104 |
A4 | 2013 year | 81853 km | $ 78743 |
A4 | 2017 year | 18607 km | $ 57742 |
Camry | 2001 year | 158831 km | $ 64156 |
A4 | 2000 year | 45036 km | $ 84130 |
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:
For filtering options when using input fields ("string" or "number" types), explore the Input Field properties.
For filtering options when using select fields ("select" type), explore the Select 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.
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 | Color | Weight (grams) |
|---|---|---|
Grapes | Green | 1894 |
Peach | Green | 460 |
Mango | Purple | 922 |
Strawberry | Purple | 563 |
Apple | Pink | 978 |
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) |
|---|---|---|
Kiwi | Yellow | 1459 |
Kiwi | Purple | 469 |
Watermelon | Purple | 765 |
Apple | Pink | 1504 |
Watermelon | Purple | 1914 |
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.
Name | Color | Weight (grams) |
|---|---|---|
Orange | Yellow | 788 |
Pineapple | Orange | 899 |
Apple | Red | 1733 |
Kiwi | Red | 933 |
Watermelon | Pink | 1227 |
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.
Search
The search property enables global search functionality across the table data.
Name | Color | Weight (grams) |
|---|---|---|
Pineapple | Pink | 140 |
Peach | Green | 242 |
Mango | Green | 481 |
Strawberry | Pink | 1407 |
Orange | Red | 1712 |
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) |
|---|---|---|
Purple | ||
Kiwi | Purple | 977 |
Pink | ||
Peach | Pink | 521 |
Orange | Pink | 600 |
Strawberry | Pink | 609 |
Yellow | ||
Orange | Yellow | 663 |
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.
Banana | Green | 1824 | false | Brazil | 8.48 |
Strawberry | Yellow | 801 | true | India | 9.05 |
Watermelon | Purple | 1587 | true | Brazil | 3.89 |
Kiwi | Purple | 1021 | false | Thailand | 2.80 |
Kiwi | Pink | 402 | false | China | 5.42 |
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) |
|---|---|---|
Apple | Pink | 878 |
Grapes | Yellow | 265 |
Banana | Green | 896 |
Kiwi | Green | 1961 |
Orange | Orange | 832 |
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.
Name | Color | Weight (grams) |
|---|---|---|
Watermelon | Yellow | 577 |
Grapes | Red | 765 |
Watermelon | Green | 1774 |
Grapes | Purple | 640 |
Banana | Yellow | 299 |
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.
Apple | Purple | 569 |
Kiwi | Green | 269 |
Peach | Pink | 736 |
Pineapple | Purple | 1189 |
Mango | Yellow | 1270 |
Count: 5 | Count: 5 | Count: 5 |
|---|
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.
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.
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 | 68822 | 386416 | 48272 | 636 |
Quarterly Analysis | 77765 | 870557 | 5670 | 17 |
Quarterly Analysis | 89646 | 931748 | 41673 | 521 |
Quarterly Analysis | 4784 | 261503 | 32535 | 926 |
Quarterly Analysis | 65391 | 578011 | 49474 | 197 |
Count: 5 | Avg: 61282 | Min: 261503 | Max: 49474 | Sum: 2297 |
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 |
|---|---|---|---|---|
Monthly Report | 92979 | 981523 | 22472 | 678 |
Monthly Report | 88283 | 908730 | 45766 | 296 |
Monthly Report | 21736 | 841481 | 27946 | 328 |
Daily Statistics | 92890 | 583388 | 23937 | 578 |
Weekly Summary | 87833 | 573059 | 38951 | 152 |
Name: 5 (count) | Total Users: 76744 (avg) | Total Revenue: 573059 (min) | Active Users: 45766 (max) | New Users Today: 2032 (sum) |
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.
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:
- Boolean Shortcut: If set to
true, pagination is enabled with default settings. - Detailed Configuration: By providing an object, you can customize the pagination behavior.
Peach | Green | 59 | false | Spain | 5.38 |
Apple | Green | 1140 | true | India | 5.87 |
Kiwi | Purple | 778 | false | India | 2.94 |
Grapes | Purple | 792 | true | USA | 3.50 |
Strawberry | Pink | 1496 | false | Mexico | 6.64 |
This enables pagination with the default configuration.
Orange | Pink | 1675 | true | Spain | 4.81 |
Apple | Purple | 1631 | true | Brazil | 2.42 |
Pineapple | Orange | 1210 | true | India | 2.75 |
Apple | Yellow | 1492 | false | Mexico | 7.54 |
Banana | Orange | 1725 | false | Thailand | 8.52 |
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.
Kiwi | Purple | 980 | false | China | 0.77 |
Mango | Yellow | 978 | false | Mexico | 8.49 |
Grapes | Purple | 293 | false | Brazil | 8.81 |
Apple | Orange | 1290 | false | USA | 2.00 |
Kiwi | Yellow | 1335 | true | China | 8.71 |
Set mode to customize the appearance of pagination controls.
startPage
The startPage property sets the initial page to display when the table is rendered.
Pineapple | Purple | 1482 | true | China | 4.82 |
Peach | Pink | 617 | false | Spain | 1.86 |
Apple | Pink | 833 | true | Brazil | 3.38 |
Pineapple | Red | 621 | true | Spain | 7.39 |
Watermelon | Green | 832 | false | Brazil | 7.87 |
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.
Orange | Green | 1440 | false | China | 4.08 |
Orange | Purple | 1263 | false | Brazil | 0.35 |
Watermelon | Orange | 1408 | true | Mexico | 4.35 |
Peach | Yellow | 999 | true | Thailand | 0.66 |
Strawberry | Yellow | 1660 | false | Brazil | 2.77 |
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.
Pineapple | Pink | 1980 | true | USA | 9.79 |
Banana | Orange | 1544 | true | Mexico | 8.86 |
Strawberry | Red | 1288 | false | Brazil | 6.76 |
Peach | Green | 1779 | true | Brazil | 0.42 |
Banana | Pink | 1994 | false | Mexico | 6.77 |
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.
Mango | Purple | 1477 | true | Spain | 9.40 |
Banana | Pink | 1570 | true | Mexico | 7.73 |
Watermelon | Yellow | 130 | false | Spain | 2.74 |
Apple | Pink | 433 | false | Mexico | 1.53 |
Watermelon | Red | 1027 | false | India | 3.39 |
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."
Apple | Red | 1517 | true | Spain | 5.68 |
Apple | Pink | 1865 | false | Spain | 1.53 |
Peach | Orange | 544 | true | China | 9.20 |
Banana | Pink | 1337 | true | Brazil | 8.37 |
Grapes | Green | 1191 | false | Mexico | 0.10 |
Set isInfoText to true to display informative pagination text.
isPageSizeSelector
The isPageSizeSelector property enables a dropdown for selecting the page size.
Apple | Red | 1641 | true | Spain | 8.64 |
Apple | Red | 149 | true | Thailand | 8.40 |
Apple | Green | 237 | true | Thailand | 2.70 |
Pineapple | Green | 114 | false | USA | 8.11 |
Mango | Yellow | 328 | false | Spain | 6.08 |
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 | Pink | 446 | false | USA | 5.51 |
Mango | Purple | 1182 | true | India | 1.31 |
Banana | Purple | 1600 | false | Mexico | 1.79 |
Kiwi | Red | 861 | false | Brazil | 7.94 |
Orange | Orange | 1164 | true | USA | 2.46 |
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.
Kiwi | Green | 1352 | false | USA | 9.79 |
Mango | Red | 1769 | false | Thailand | 2.44 |
Mango | Green | 509 | true | USA | 0.98 |
Mango | Green | 547 | true | China | 2.44 |
Strawberry | Red | 381 | false | India | 4.83 |
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 | Color | Weight (grams) |
|---|---|---|
Banana | Orange | 437 |
Watermelon | Red | 1736 |
Apple | Green | 1857 |
Watermelon | Purple | 786 |
Orange | Yellow | 518 |
Note: To display the toolbar, the
visibleproperty must be explicitly set totruein thetoolbarconfiguration.
By using the #toolbar slot, you can inject custom content into the toolbar area while ensuring it is visible by setting visible: true.
#header
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 | Color | Weight (grams) |
|---|---|---|
Watermelon | Yellow | 1860 |
Pineapple | Yellow | 1429 |
Orange | Orange | 194 |
Pineapple | Green | 921 |
Apple | Purple | 1578 |
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) |
|---|---|---|
Purple | ||
Kiwi | Purple | 1505 |
Mango | Purple | 505 |
Kiwi | Purple | 362 |
Banana | Purple | 1344 |
Pineapple | Purple | 1197 |
Use the #group slot to define how grouped rows should be displayed.
#footer
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) |
|---|---|---|
Kiwi | Orange | 1337 |
Watermelon | Red | 538 |
Peach | Yellow | 388 |
Orange | Red | 1041 |
Peach | Yellow | 1382 |
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) |
|---|---|---|
Grapes | Red | 681 |
Banana | Pink | 249 |
Mango | Red | 1193 |
Mango | Purple | 1321 |
Apple | Purple | 1086 |
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.
Name | Color | WeightGrams |
|---|---|---|
Grapes | Red | 1991 |
Banana | Orange | 679 |
Orange | Red | 772 |
Watermelon | Purple | 113 |
Peach | Green | 1640 |
Кол. 500 | Кол. 500 | Кол. 500 |
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.
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.
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 | 1724 |
Apple | Pink | 1503 |
Strawberry | Pink | 570 |
Grapes | Green | 1398 |
Mango | Red | 1670 |
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.
Name | Color | WeightGrams |
|---|---|---|
Yellow | ||
Pineapple | Yellow | 528 |
Strawberry | Yellow | 856 |
Apple | Yellow | 978 |
Orange | Yellow | 304 |
Apple | Yellow | 1530 |
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.
Name | Color | WeightGrams |
|---|---|---|
Red | ||
Apple | Red | 1861 |
Strawberry | Red | 851 |
Kiwi | Red | 1195 |
Grapes | Red | 132 |
Orange | Red | 1376 |
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.
Grapes | Yellow | 1113 |
Kiwi | Purple | 1325 |
Grapes | Red | 1325 |
Apple | Pink | 1868 |
Peach | Green | 274 |
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.
Name | Color | WeightGrams |
|---|---|---|
Kiwi | Purple | 937 |
Kiwi | Yellow | 1056 |
Grapes | Pink | 185 |
Watermelon | Green | 423 |
Mango | Pink | 1243 |
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.
Name | Color | WeightGrams |
|---|---|---|
Strawberry | Red | 1302 |
Pineapple | Yellow | 1475 |
Mango | Red | 987 |
Grapes | Orange | 372 |
Mango | Green | 1228 |
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) |
|---|---|---|
Mango | Pink | 1107 |
Banana | Purple | 840 |
Mango | Yellow | 1337 |
Banana | Purple | 608 |
Orange | Orange | 1097 |
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) |
|---|---|---|
Pineapple | Red | 672 |
Apple | Purple | 1647 |
Banana | Green | 1629 |
Apple | Red | 1722 |
Apple | Pink | 77 |
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) |
|---|---|---|
Peach | Yellow | 1737 |
Apple | Purple | 1026 |
Mango | Yellow | 1238 |
Pineapple | Purple | 1104 |
Kiwi | Red | 615 |
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) |
|---|---|---|
Watermelon | Orange | 386 |
Watermelon | Red | 1267 |
Kiwi | Pink | 1102 |
Banana | Green | 1450 |
Strawberry | Green | 756 |
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) |
|---|---|---|
Peach | Red | 1400 |
Orange | Pink | 1938 |
Grapes | Yellow | 121 |
Grapes | Purple | 1603 |
Banana | Yellow | 558 |
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) |
|---|---|---|
Mango | Pink | 1657 |
Watermelon | Pink | 1081 |
Strawberry | Orange | 878 |
Apple | Green | 414 |
Pineapple | Green | 1527 |
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) |
|---|---|---|
Orange | Pink | 1990 |
Apple | Red | 663 |
Orange | Green | 550 |
Strawberry | Yellow | 103 |
Mango | Red | 876 |
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) |
|---|---|---|
Kiwi | Purple | 677 |
Mango | Pink | 775 |
Strawberry | Yellow | 1345 |
Mango | Pink | 696 |
Strawberry | Orange | 1817 |
Кол. 5 | Кол. 5 | Кол. 5 |
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 | Purple | 883 |
Orange | Purple | 1384 |
Mango | Yellow | 1102 |
Peach | Purple | 745 |
Kiwi | Orange | 1485 |
Кол. 5 | Кол. 5 | Кол. 5 |
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 |
|---|---|---|---|
David | user | 08.07.2022 | 27.12.2023 |
Eve | admin | 03.03.2024 | 09.03.2025 |
Eve | user | 17.09.2024 | 09.07.2022 |
Judy | admin | 15.11.2025 | 03.05.2022 |
Judy | admin | 24.05.2022 | 09.11.2023 |
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 |
|---|---|---|
David | user | |
Eve | admin | |
Eve | user | |
Judy | admin | |
Judy | admin |
In this example, editing is enabled for the id and name columns but disabled for the age column.
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
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:
For configuration options when using input fields ("string" or "number" types`), explore the Input Field properties.
For configuration options when using select fields ("select" type), explore the Select 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.