<!--
{
  "availability" : [
    "Apple News Format: 1.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleNewsFormat",
  "identifier" : "/documentation/AppleNewsFormat/TableRowStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Object",
  "symbol" : {
    "kind" : "Object",
    "modules" : [
      "Apple News Format"
    ],
    "preciseIdentifier" : "data:news_format:TableRowStyle"
  },
  "title" : "TableRowStyle"
}
-->

# TableRowStyle

The object for applying styles to rows in a table.

```
object TableRowStyle
```

## Discussion

You can apply styles that affect the look of the table rows, including the row background color, the color of the divider lines between rows, and the height of a row. For example, you could add a blue background color and apply a medium-gray divider to each row in your table.

You can also set up conditional row styles — styles applied only to rows that meet certain criteria. For example, you could apply a background shading to all odd-numbered rows. See [`ConditionalTableRowStyle`](/documentation/AppleNewsFormat/ConditionalTableRowStyle).

You can use this object in [`TableStyle`](/documentation/AppleNewsFormat/TableStyle).

### Example

```json
{
  "components": [
    {
      "role": "datatable",
      "style": "exampleTableStyle",
      "showDescriptorLabels": true,
      "sortBy": [
        {
          "descriptor": "id-name",
          "direction": "descending"
        }
      ],
      "data": {
        "descriptors": [
          {
            "identifier": "id-name",
            "key": "name",
            "label": {
              "type": "formatted_text",
              "text": "Name",
              "textStyle": {
                "textColor": "black"
              }
            },
            "dataType": "string"
          },
          {
            "identifier": "id-occupation",
            "key": "occupation",
            "label": "Occupation",
            "dataType": "string"
          }
        ],
        "records": [
          {
            "name": "Amelia Earhart",
            "occupation": "Pilot"
          },
          {
            "name": "Grace Hopper",
            "occupation": "Computer Scientist"
          }
        ]
      }
    }
  ],
  "componentStyles": {
    "exampleTableStyle": {
      "tableStyle": {
        "rows": {
          "backgroundColor": "#fff",
          "divider": {
            "width": 1,
            "color": "#ddd"
          },
          "conditional": [
            {
              "selectors": [
                {
                  "even": true
                }
              ],
              "backgroundColor": "#eeeeee"
            }
          ]
        },
        "headerRows": {
          "backgroundColor": "#ccc",
          "divider": {
            "width": 2,
            "color": "#999"
          }
        },
        "cells": {
          "padding": 6,
          "verticalAlignment": "top"
        }
      }
    }
  }
}
```

## Relationships

### Inherited By

[`ConditionalTableRowStyle`](/documentation/AppleNewsFormat/ConditionalTableRowStyle)

---

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)