---
title: HTMLTable
framework: applenewsformat
role: symbol
role_heading: Object
path: applenewsformat/htmltable
---

# HTMLTable

The component for adding tables with HTML data.

## Declaration

```data
object HTMLTable
```

## Properties

html: The HTML for the table. This HTML must begin with <table> and end with </table>. role: Always htmltable for this component. anchor: An object that defines vertical alignment with another component. animation: An object that defines an animation to be applied to the component. The none value is used for conditional design elements. Adding it here has no effect. behavior: An object that defines behavior for a component, like Parallax or Springy. The none value is used for conditional design elements. Adding it here has no effect. conditional: An instance or array of component properties that can be applied conditionally. hidden: A Boolean value that determines whether the component is hidden. identifier: An optional unique identifier for this component. If used, this identifier must be unique across the entire document. You will need an identifier for your component if you want to anchor other components to it. layout: An inline ComponentLayout object that contains layout information, or a string reference to a ComponentLayout object that is defined at the top level of the document. If layout is not defined, size and position will be based on various factors, such as the device type, the length of the content, and the role of this component. style: An inline ComponentStyle object that defines the appearance of this component, or a string reference to a ComponentStyle object that is defined at the top level of the document. The none value is used for conditional design elements. Adding it here has no effect.

## Discussion

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 {   "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](applenewsformat/component.md)

## See Also

### Tables with HTML Data

- [Adding an HTML Table](applenews/adding-an-html-table.md)
