Styles
Styles allow a developer to have fine-grained control over the rendering of a table's cells. Styles can be applied on rows (at an object-table
level) and/or on cells (at a column
level).
As a single expression (style
)
style
)A single function can be used in the style=""
attribute to return a single payload of styling information.
For a complete list of available properties see the Full list of styles section below.
As individual styles
For a complete list of available properties see the Full list of styles section below.
Applied on a column
level
column
levelAll the style attributes (both style
and style-[property]
) can also be applied to a column
instead of the object-table
. In this case, the styling only applies to cells in that specific column
and takes precedence over the styles applied on the object-table
level.
Note: It is possible to combine both row level and cell level style attributes.
Full list of styles
The following is the complete list of supported styles available:
JSON Syntax | Attribute Syntax | Description | |
---|---|---|---|
|
|
| Align the text content inside a cell to the left, right or center |
|
| string | Color of the text |
|
| string | Color of icon on the left of the cell |
|
| boolean | Makes the text bold or normal weight |
|
| boolean | Makes the text italic or normal weight |
|
| boolean | Makes the text underlined |
|
| boolean | Makes the text have a strikethrough |
|
| string | The background color of the entire cell |
Cell Icons
Cells inside a column can render icons. The icons can either be statically defined or provided as the result of a function that has access to $object
.
To change the color of the icon, use the iconColor
style (as seen in the full list of available cell styles)
Cells with icons only
It is sometimes desirable to have the content of a cell only be an icon, this can be achieved with fit="shrink"
as well as omitting the heading
and display
attributes.
Tip: This is particularly useful for status indicators in tables.
Last updated