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 the table uses.
The following table lists the styles that you can apply to the rows, columns, and cells in tables. All can be conditional styles that Apple News Format applies 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 |