Object

ConditionalTableRowStyle

The object for applying styles to table rows that meet certain conditions.

Properties

backgroundColor

The background color for the row.

If this property is omitted, the background is transparent.

The cell’s background color is highest priority, followed by column, and finally row. All three colors are applied, meaning that non-opaque values can cause combined colors. For example, using a red row together with a blue column, both with 50% opacity, creates a purple cell.

The stroke style for the divider line below the row.

height
*

The height of the row, as a number in points, or using one of the available units of measure for components. See Specifying Measurements for Components.

By default, the height of each row is determined by the height of the content in that row.

selectors
(Required)

An array of one or more selectors, each of which specifies one or more conditions.

This conditional table row style will be applied to rows that meet all of the conditions of at least one of these selectors.

Discussion

Table rows can have conditional styles—styles that are applied only to rows that meet certain conditions. Any table row style can be used as a conditional style.

For example, you might define a conditional table row style that changes the background color for all even-numbered rows.

This object can be used in TableRowStyle.

Example

{ "components": [ { "role": "datatable", "style": "exampleTableStyle", "showDescriptorLabels": true, "sortBy": [ { "descriptor": "id-name", "direction": "descending" } ], "data": { "descriptors": [ { "identifier": "id-name", "key": "name", "label": { "type": "formatted_text", "text": "Name", "textStyle": { "textColor": "black" } }, "dataType": "string" }, { "identifier": "id-occupation", "key": "occupation", "label": "Occupation", "dataType": "string" } ], "records": [ { "name": "Amelia Earhart", "occupation": "Pilot" }, { "name": "Grace Hopper", "occupation": "Computer Scientist" } ] } } ], "componentStyles": { "exampleTableStyle": { "tableStyle": { "rows": { "backgroundColor": "#fff", "divider": { "width": 1, "color": "#ddd" }, "conditional": [ { "selectors": [ { "even": true } ], "backgroundColor": "#eeeeee" } ] }, "headerRows": { "backgroundColor": "#ccc", "divider": { "width": 2, "color": "#999" } }, "cells": { "padding": 6, "verticalAlignment": "top" } } } }}

Relationships

Inherits From

See Also

Table Styles

Defining and Using Table Styles

Apply table styles, such as borders and backgrounds, to the rows, columns, and cells in your HTML and JSON tables.

object TableStyle

The object for defining a style for rows, columns, cells, and headers in a table.

object TableRowStyle

The object for applying styles to rows in a table.

object TableRowSelector

The object for defining conditions that will cause a conditional style to be applied to a row.

object TableColumnStyle

The object for applying styles to columns in a table.

object ConditionalTableColumnStyle

The object for applying styles to table columns that meet certain conditions.

object TableColumnSelector

The object for defining conditions that will cause a conditional style to be applied to a column.

object TableCellStyle

The object for applying styles to cells in a table.

object ConditionalTableCellStyle

The object for applying a style to table cells that meet certain conditions.

object TableCellSelector

The object for defining conditions that will cause a conditional style to be applied to a cell.

object TableBorder

The object for setting borders for tables.

object TableStrokeStyle

The object for defining the color, width, and style of a stroke in a table.

object Padding

The object for defining space around the content in a table cell.

object FormattedText

The object for specifying formatted text content and styling for captions in table cells.