<!--
{
  "documentType" : "article",
  "framework" : "AppleNewsFormat",
  "identifier" : "/documentation/AppleNews/defining-and-using-table-styles",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Defining and Using 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.

## Discussion

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`](/documentation/AppleNewsFormat/FormattedText) as the value of a key-value pair in a record in [`RecordStore`](/documentation/AppleNewsFormat/RecordStore). The [`DataDescriptor`](/documentation/AppleNewsFormat/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`](/documentation/AppleNewsFormat/TableStyle) object in the [`ComponentStyle`](/documentation/AppleNewsFormat/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|

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)