Object

ConditionalTableColumnStyle

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

Properties

backgroundColor

The background color for the column.

If this property is omitted, the background will be 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.

Version 1.5

The stroke style for the divider line to the right of the column.

Version 1.5

minimumWidth
*

The minimum width of the column as an integer in points or in one of the available units of measure for components. See Specifying Measurements for Components.

Version 1.5

(Required)

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

This conditional table column style will be applied to columns that meet all of the conditions of at least one of the selectors.

Version 1.5

width
integer

The relative column width. This value influences the distribution of column width but does not dictate any exact values. To set an exact minimum width, use minimumWidth instead.

It might be useful to think of the value of width as a percentage of the component’s width. For example, if you know that one column’s width should be about half that of the whole component, and another should be about a quarter of the component width, use values of 50 and 25.

Version 1.5

Discussion

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

For example, you might define a conditional table column style that changes the background color for all odd-numbered columns.

This object can be used in TableColumnStyle.

Example

{ "components": [ { "role": "datatable", "style": "bookTableStyle", "showDescriptorLabels": true, "sortBy": [ { "descriptor": "id-publication-date", "direction": "ascending" } ], "data": { "descriptors": [ { "identifier": "id-publication-date", "key": "publicationDate", "label": "Date", "dataType": "string" }, { "identifier": "id-title", "key": "title", "label": "Title", "dataType": "string" }, { "identifier": "id-publisher", "key": "publisher", "label": "Publisher", "dataType": "string" } ], "records": [ { "title": "Mardi", "publicationDate": "1849", "publisher": "Harper & Brothers" }, { "title": "Typee", "publicationDate": "1846", "publisher": "Wiley and Putnam" }, { "title": "White-Jacket", "publicationDate": "1850", "publisher": "Harper & Brothers" }, { "title": "Omoo", "publicationDate": "1847", "publisher": "Harper & Brothers" }, { "title": "Redburn", "publicationDate": "1849", "publisher": "Harper & Brothers" }, { "title": "Moby-Dick", "publicationDate": "1851", "publisher": "Harper & Brothers" } ] } } ], "componentStyles": { "bookTableStyle": { "tableStyle": { "columns": { "backgroundColor": "#eeeeee", "conditional": [ { "selectors": [ { "columnIndex": 0 } ], "backgroundColor": "#dddddd" } ] }, "headerCells": { "padding": 5, "textStyle": { "fontWeight": "bold" } }, "cells": { "padding": 2 } } } }}

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 ConditionalTableRowStyle

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

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 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.