Article

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.

Overview

Apple News Format lets you apply styles to individual rows, columns, and cells in your HTML and JSON data tables. In addition, you can apply text styles to text in table cells. In an HTML table, you format the text using HTML. In a JSON table, you use FormattedText as the value of a key-value pair in a record in RecordStore. The DataDescriptor for that record must have a dataType of text.

To set the style for the rows, columns, and cells in a table, you use the TableStyle object in the ComponentStyle used by the table.

The following table lists the styles that you can apply to the rows, columns, and cells in tables. All can be conditional styles that are applied to parts of the table that meet certain criteria, such as odd-numbered rows or a cell in a specific location.

Parts of the table

Style options

Rows and row headers

Background color or fill, divider lines, row height

Columns and column headers

Background color or fill, divider lines, minimum column width, column width

Cells and cell headers

Background color or fill, border, cell height, horizontal alignment, minimum width, cell padding, vertical alignment, cell width

See Also

Table Styles

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