Table components

This topic introduces table components. You add table components to invoice body sections.

Invoice builder supports two tokens that each return a list of data that appears in tables on invoices: invoice line data and tax summary data. Additional topics describe how you use some or all of the table JSON schema to build those tables: Build invoice line tables and Build tax summary tables.

Table components are contained in cells. When you build table components, you define the table, table header, and table body.

Table defines the following:

Header defines the following:

Body defines the following for each column:

You can apply styles to all table elements.

You can add table components to cell components. See Build cell components.

Table component JSON schema

The complete table component JSON schema is shown below. The elements used for the invoice lines and tax summary tables are defined in the following topics: Build invoice line tables and Build tax summary tables.

{
    "type": "table",
    "data": "<repeating_data_token>",
    "style": { },
    "properties": {
        "visible": < true | false >
    },
    "sortingCriteria": [{
        "key": "<column_name_token>",
        "order": "<asc | desc>"
    }],
    "customSortingCriteria": [
        {
            "key": "<column_name_token",
            "order": [
                "<value_1>",
                "<value_2>",
                ...
            ]
        }
    ],
    "groupingCriteria": ["<column_name_1">, "<column_name_2>", ... ],
    "header": {
        "style": { },
        "properties": {
            "visible": <true | false>
        },
        "columns": [
            {
                "style": { },
                "properties": { },
                "type": "text",
                "label": "<column name>"
            },
            {
                "style": {},
                "properties": { },
                "type": "text",
                "label": "<column name>"
            }
            ...
        ]
    },
    "body": {
        "style": { },
        "properties": {
            "visible": <true | false>
        },
        "columns": [
            {
                "style": {},
                "properties": { },
                "data": "<{{token}}>",
                "type": "<text | Markdown>"
            },
            {
                "style": {},
                "properties": { },
                "data": "<{{token}}>",
                "type": "<text | Markdown>"
            }
            ...
        ]
    }
}