Object

TableRowSelector

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

Properties

descriptor
string

A string that specifies the identifier of a specific data descriptor. All rows for this data descriptor will be selected. See DataDescriptor.

When dataOrientation is set to horizontal, which is not the default each row displays data for one data descriptor. See DataTable.

even
boolean

A Boolean value when true, selects the even rows.

odd
boolean

A Boolean value when true, selects the odd rows.

rowIndex
integer

A number that specifies a row index. The topmost row of data has an index of 0. The specified column is selected.

Discussion

Use the TableRowSelector object to set the criteria that must be met in order for conditional styles to be applied to rows. For example, you could set criteria to select all odd rows, all even rows, or a single row.

This object can be used in ConditionalTableRowStyle.

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" } } } }}

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 ConditionalTableRowStyle

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

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.