customizeCell(customizationFunction:Function)
Renders each cell and can change its content. Allows adding links, custom styles, formatting. Available both as an initialization parameter or an API call.
Gets customizationFunction
as an input parameter. customizationFunction
has the following signature:
function customizeCellFunction(cellBuilder, cellData)
AcellBuilder
object contains information about the cell representation and provides methods for the cell customization. The structure of cellBuilder
:
Name | Type | Description |
---|---|---|
attr | Object | Specifies all the 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 the cell classes. A new class can be added via the addClass() method. |
style | Object | Contains a CSS style of 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. |
A cellData
object contains all the information about the cell and its data. Learn more about the structure of a Cell Data Object.
Add alternative colors for the rows: