Skip to content

Table element

Repeats rows over a secondary dataset (invoice lines, order items). Inside the table, bare names resolve to the table’s row first and then to the enclosing body row; aggregates in the footer default to the table’s rows.

- { type: table, dataset: ..., columns: ... }
table.report.yaml
title: Order lines
culture: en-US
styles:
header: { fontWeight: bold, borderBottom: "0.75pt solid #000000", padding: 2pt 0 }
data:
lines: { fields: { Product: string, Quantity: int32, Price: decimal } }
body:
reportHeader:
- content:
- type: table
dataset: lines
sort: [Product]
headerStyle: header
columns:
- { header: Product, value: "{Product}", width: 3fr }
- { header: Qty, value: "{Quantity}", width: 1fr, align: end }
- { header: Price, value: "{Price:C}", width: 1fr, align: end }
- { header: Amount, value: "{Quantity * Price:C}", width: 1fr, align: end }
footer:
- borderTop: "0.75pt solid #000000"
cells:
- { value: Total, span: 3, fontWeight: bold }
- { value: "{Sum(Quantity * Price):C}", fontWeight: bold, align: end }
table.data.yaml
data:
lines:
- { Product: Support contract, Quantity: 1, Price: 480.00 }
- { Product: Consulting (hours), Quantity: 12, Price: 95.00 }
- { Product: Training day, Quantity: 2, Price: 650.00 }
The table example, rendered by Tagua.

Type: text · Required

The dataset whose rows the table repeats.

Type: expression

Row filter; may reference the enclosing row, e.g. =InvoiceId == Parent.Id.

Type: list of sort key

Row order.

Type: list of object · Required

The columns: header, value and width.

Type: true or false · Default: true

Shows the row of column headers.

Type: true or false · Default: true

Repeats the header row on every page the table continues onto.

Type: text

A named style for the header row.

Type: object

Style properties for the header row taken from the data (parameters, variables), over its named style.

Type: list of object

Rows between the column headers and the data rows, such as an opening balance. They see the first data row, as footer rows see the last, and the table’s totals.

Type: list of object

The rows each data row shows, in place of the columns’ values: for a record that takes more than one row (a line and its description under it), or cells that span columns.

Type: list of object

Groups of the data rows, outermost first: runs of consecutive rows with the same key (sort by the keys first), each with rows before and after it, such as a heading and a subtotal.

Type: list of object

Rows after the data rows, such as totals.

Type: text

Text shown instead of the body when there are no rows.

Each entry of columns. Columns also have the style properties, which apply to their data cells.

Type: text

A named style for the column’s data cells.

Type: text

Header text (template). Becomes a TH cell in the structure tree. Like the rows before the data, it sees the table’s first row, and its aggregates cover the table’s rows: "{Count()} orders".

Type: list of element

Elements the header cell holds instead of its text: texts side by side in a row, say. They are laid out at the column’s width, with the values the header sees, as a cell’s content is.

Type: text

Cell text (template), evaluated for each row. Required, unless the table has detail rows.

Type: expression

Shows the cell’s text only where this is true; elsewhere the cell is empty, and keeps its width and borders.

Type: length · Default: 1fr

Column width: pt (or another unit), %, fr (a share of the width left) or auto (as wide as its content).

Type: list of object

Styles for the column’s data cells that apply, row by row, where their condition holds.

Type: object

Style properties for the column’s data cells taken from each row, e.g. background: =RowColor.

Type: keyword · Default: none

Reads the data cells’ text as HTML (see the text element’s markup).

One of:

  • none: As it is: every character is shown.
  • html: As a small subset of HTML, once its expressions are filled in: b, strong, i, em, u, s, br, paragraphs and divs, lists, headings (in bold), font color, and the color, font-weight, font-style and text-decoration of a style attribute. Spaces collapse, and entities such as & are read. Other tags are left out, with their text kept; font sizes and faces are not used.

A group of a table’s data rows: a run of consecutive rows with the same key. Its header rows see its first row, its footer rows its last, and aggregates in them cover the group. Each entry of groups, outermost first. In a group’s header and footer rows, an aggregate without a scope covers the group; elsewhere in the table, the table.

Type: text · Required

Also the name by which the table’s rows read the current group key, and the aggregate scope.

Type: expression · Required

The group key: a new group starts where it changes.

Type: list of object

Rows before each group’s rows, such as a heading.

Type: list of object

Rows after each group’s rows, such as a subtotal.

Each entry of before (rows between the header and the data, which see the first data row), of detail (the rows each data row shows), of footer (rows after the data, which see the last), and of a group’s header and footer, with the style properties too.

Type: text

A named style for the row.

Type: expression

Leaves the row out where this is false.

Type: list of object · Required

The cells, left to right (right to left in rtl text).

Each entry of a row’s cells, with the style properties too.

Type: text

A named style for the cell.

Type: text

Cell text (template).

Type: expression

Shows the cell’s text or content only where this is true; elsewhere the cell is empty, and keeps its width and borders.

Type: list of element

Elements the cell holds instead of text: an image, a subreport, a stack of texts. They are laid out top to bottom at the cell’s width, with the row’s values, as a band’s elements are. Tables, matrices and charts cannot be nested in a cell.

Type: whole number · Default: 1

The number of columns the cell covers.

Type: true or false · Default: false

Marks the cell as a row header (TH with Row scope) for tagging.

Type: list of object

Styles that apply where their condition holds, e.g. a negative amount in red.

Type: object

Style properties taken from the data, e.g. color: =StatusColor.

Type: keyword · Default: none

Reads the cell’s text as HTML (see the text element’s markup).

One of:

  • none: As it is: every character is shown.
  • html: As a small subset of HTML, once its expressions are filled in: b, strong, i, em, u, s, br, paragraphs and divs, lists, headings (in bold), font color, and the color, font-weight, font-style and text-decoration of a style attribute. Spaces collapse, and entities such as & are read. Other tags are left out, with their text kept; font sizes and faces are not used.

It also has the properties of every element and the style properties.