table

A table. The body is pipe-delimited rows with inline Chalk in the cells, or nothing at all when data: binds a dataset instead. Header and footer rows and columns are switchable, and rows, columns or single cells can be highlighted.

tableNodeAliases:tbl

#Attributes

dataImplicit
A @data dataset supplying the rows, in place of a body — table:#survey. The same rows can then feed a table, a mark and a code environment without being typed once per consumer.
Can be written as shorthand: table:value
columns
Which columns of data: to show, and in what order — plain column names, not references, so no #. Omit for every column in the dataset's own order.
header-row
Has header row. With data:, the dataset's column names are that row.
Also written: header
Defaulttrue
header-column
Has header column.
Also written: header-col
Defaultfalse
footer-row
Has footer row.
Defaultfalse
footer-column
Has footer column.
Also written: footer-col
Defaultfalse
highlight-rows
Row indices to highlight.
Also written: highlight-row
highlight-columns
Column indices to highlight.
Also written: highlight-cols, highlight-col, highlight-column
highlight-cells
Cells to highlight, comma-separated. A single reference is a column letter and a row number (B2); a range joins two with a hyphen (A1-C3) and covers the block between them.
Also written: highlight-cell
highlight-colour
Highlight colour.
bluelight-bluedark-blueredlight-reddark-redorangelight-orangedark-orangeyellowlight-yellowdark-yellowteallight-tealdark-tealgreenlight-greendark-greenpinklight-pinkdark-pinkpurplelight-purpledark-purplegreylight-greydark-greyneutralhex(…)rgb(…)
Also written: highlight-color
Defaultblue
delimiter
Column delimiter character.
Also written: delim
Default|
title
A caption above the table. Inline Chalk, so Yield at $T = 300K$ sets the maths.
Also written: caption
mode
How the table presents: inline for a static display in place, environment to expand it into the canvas.
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{
    Name | Score
    Alice | 92
    Bob | 88
}(
    header-row: true
)
table{
    x | y
    0 | 0
    1 | 1
}(
    title: Sample Data
    highlight-rows: 2
)

#Notes

  • highlight-rows and highlight-columns are 1-based and count every row and column drawn, the header among them — so with header-row on, the first row of data is row 2.
  • Every row needs the same number of delimiters as the header: rows are split on the delimiter and nothing is padded, so a row missing one renders short and its cells sit under the wrong headings. A cell with no value keeps its delimiters — write a placeholder in it rather than leaving the line to end early.

Last updated