Documentation menu
customizeCell
customizeCell(customizationCellFunction: Function)
A hook that is triggered for each cell to customize its content and style. Supports adding links, custom styles, and formatting. Available both as an initialization parameter and an API call.
Parameters
customizationCellFunction
— a function that defines which cells will be customized and how. Receives the following parameters:
Parameter | Type | Description |
---|---|---|
cellStyle | Cell Style Object | Contains information about the cell representation. Use this object to customize cell appearance. |
cellData | Cell Data Object | Contains information about the cell and its data. |
Cell Style Object:
Parameter | Type | Description |
---|---|---|
attr | Object | Specifies the cell’s attributes and their values. It allows adding custom attributes, which later can be used in CSS selectors. Additional info about CSS attribute selectors. |
classes | Array of Strings | Contains all cell’s classes. A new class can be added via the addClass() method (see below). |
style | Object | Contains a CSS style for the cell. |
tag | String | Contains a tag element of the cell. |
text | String | Contains a text of the cell (may contain HTML elements, e.g., images). |
addClass(value: String) | Method | Adds a new class to the cell. |
toHtml() | Method | Returns the cell as an HTML string. |
Example
Add colors to alternate rows: