COMPONENTS
Table
Demo
Code
Documentation
Installation
Step 1
Install the ip-table component as a dependency in your project:
npm install ip-accordionStep 2
Import the module into your script file:
Usage
To use this component, we must add the properties as attributes.
Properties
| Property | Attribute | Necessity | Description | Type | Default |
|---|---|---|---|---|---|
| columns | columns | Required | This is a JSON string representing an array of objects for thead. | string | Undefined |
| rows | rows | Required | This is a JSON string representing an array of objects for tbody. | string | Undefined |
Columns Property
The columns property is a JSON string representing an array of column definitions. Each column must have a header and a type:
- header: A string that represents the name of the column. This will be displayed as the column header in the table.
- type:A string that represents the type of data in the column. This should be either 'string' or 'number'. This is used to determine how to sort the column. 'string' type columns are sorted alphabetically, while 'number' type columns are sorted numerically.
Rows Property
The rows property is a JSON string representing an array of row objects.Each row object should contain key-value pairs where keys correspond to the column headers and values represent the cell data.
Customization
We have a set of predefined variables used to customize the table:
--primary-color--secondary-color--thead-color--hover-color--font-size--font-family
To update the values use the following: