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

# HTMLTable

The component for adding tables with HTML data.

```
object HTMLTable
```

## Discussion

To add a table with HTML data, create a component with a `role` of `htmltable`. The required `html` property holds all the data and tags for an HTML table.

### Example

```json
{
  "components": [
    {
      "role": "htmltable",
      "html": "<table><tr><th>Name</th><th>Occupation</th></tr><tr><td><strong>Grace Hopper</strong></td><td>Computer Scientist</td></tr><tr><td><strong>Amelia Earhart</strong></td><td>Pilot</td></tr></table>",
      "style": {
        "tableStyle": {
          "rows": {
            "backgroundColor": "#fff",
            "conditional": [
              {
                "selectors": [
                  {
                    "odd": true
                  }
                ],
                "backgroundColor": "#f7f7f7"
              }
            ]
          }
        }
      }
    }
  ]
}
```

## Relationships

### Inherits From

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

---

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)