Object

TableCellStyle

The object for applying styles to cells in a table.

Properties

backgroundColor

The background color for the cell.

If this property is omitted, the background is transparent.

The cell background color is highest priority, followed by the column, and finally the 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 cell, both with 50% opacity, creates a purple cell.

The border for the cell. Because the border is drawn inside the cell, it affects the size of the content within the cell. The bigger the border, the less available space for content.

An array of styles to be applied only to cells that meet specified conditions. This can be used to change the appearance of specific table cells.

height
*

The height of the cell and its row, as a number in points, or using one of the 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.

horizontalAlignment
string

Defines the horizontal alignment of content inside cells.

minimumWidth
*

The minimum width of the cell and its column, as a number in points or in one of the available units of measure for components. See Specifying Measurements for Components.

padding
*

The space around the content in a table cell in points, supported units, or a Padding object that specifies padding for each side separately.

textStyle
*

The name string of one of your styles in the Article ArticleDocument.componentTextStyles object.

verticalAlignment
string

Defines the vertical alignment of content inside cells.

width
integer

The column width, as a percentage only. This property only indicates proportionate width and cannot be used to control exact width. See minimumWidth.

Discussion

You can apply styles that affect the look of the cells in your tables, including the background color, the horizontal alignment of cell contents, and the cell height, width, and padding.

You can also specify conditional styles for cells—styles that are applied to cells that meet certain criteria. For example, you might choose to change the background color for a cell at a specific location. See ConditionalTableCellStyle for more information.

This object can be used in TableStyle.

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

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