table

A table on the canvas, its rows written in the body or bound from an @data dataset.

tableNodeExplained in Layout & contentAliases:tbl
On this page
A table titled Three of the Galápagos, giving the area in square kilometres and the number of plant species for Baltra, Bartolomé and Santa Cruz, the Santa Cruz row highlighted blue.A table titled Three of the Galápagos, giving the area in square kilometres and the number of plant species for Baltra, Bartolomé and Santa Cruz, the Santa Cruz row highlighted blue.

#Attributes

dataImplicit
A @data dataset supplying the rows, in place of a body: table:#survey. With it, the body is ignored. Its column names are the header row.
Can be written as shorthand: table:value
columns
Which columns of data: to show, in order — plain column names, without #. Unwritten, every column in the dataset's order.
header-row
The first row is styled as a header. With data:, the dataset's column names are that row.
Also written: header
Defaulttrue
header-column
The first column is styled as a header.
Also written: header-col
Defaultfalse
footer-row
The last row is styled as a footer.
Defaultfalse
footer-column
The last column is styled as a footer.
Also written: footer-col
Defaultfalse
highlight-rows
Rows to highlight, counted from 1 with the header row included: 2, 2, 4, 2-4.
Also written: highlight-row
highlight-columns
Columns to highlight, counted from 1 or written as letters: 2, B, B-C.
Also written: highlight-cols, highlight-col, highlight-column
highlight-cells
Cells to highlight, comma-separated. A cell is a column letter and a row number (B2, rows counted with the header); a range joins two with a hyphen (A1-C3) and covers the block between them.
Also written: highlight-cell
highlight-colour
The highlight's colour.
paint
Also written: highlight-color
Defaultblue
delimiter
The single character that separates cells in the body.
Also written: delim
Default|
title
A caption set above the table. Rich text, so Yield at $T = 300K$ sets the maths.
Also written: caption
mode
Has no effect on how the table renders.
inlineenvironment
Defaultinline

#Allowed content

Body { }Pipe-delimited table rows with inline Chalk formatting in cells — or none at all, when data: supplies the rows from a dataset

#Allowed in

#Examples

table{
    Island     | Area (km²) | Species
    Baltra     | 25.09      | 58
    Bartolomé  | 1.24       | 31
    Santa Cruz | 903.82     | 444
}(
    title: Three of the Galápagos
    highlight-rows: 4
)
table:#survey(
    columns: island, species
    highlight-columns: 2
)

#Notes

  • The body is one row per line, split into cells on delimiter; each cell takes inline Chalk.
  • Nothing is padded: a row with a delimiter missing renders short, its cells under the wrong headings. An empty cell keeps its delimiters.
  • highlight-rows, highlight-columns and highlight-cells count from 1 and count every row and column drawn, the header among them — so with header-row on, the first row of data is row 2.
  • A table bound to a dataset that is missing or not attached shows the reason in place of its rows.

Last updated