table
ShowableShowable functions can be customized with show
rules.
show
rules.A table of items.
Tables are used to arrange content in cells. Cells can contain arbitrary content, including multiple paragraphs and are specified in row-major order. Because tables are just grids with configurable cell properties, refer to the grid documentation for more information on how to size the table tracks.
Example
#table(
columns: (1fr, auto, auto),
inset: 10pt,
align: horizon,
[], [*Area*], [*Parameters*],
image("cylinder.svg"),
$ pi h (D^2 - d^2) / 4 $,
[
$h$: height \
$D$: outer radius \
$d$: inner radius
],
image("tetrahedron.svg"),
$ sqrt(2) / 12 a^3 $,
[$a$: edge length]
)

ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
cells
contentPositionalPositional parameters are specified in order, without names.VariadicVariadic parameters can be specified multiple times.
The contents of the table cells.
rows
Defines the row sizes. See the grid documentation for more information on track sizing.
columns
Defines the column sizes. See the grid documentation for more information on track sizing.
gutter
Defines the gaps between rows & columns. See the grid documentation for more information on gutters.
column-gutter
Defines the gaps between columns. Takes precedence over gutter
.
See the grid documentation for more information on gutters.
row-gutter
Defines the gaps between rows. Takes precedence over gutter
.
See the grid documentation for more information on gutters.
fill
How to fill the cells.
This can be a color or a function that returns a color. The function is passed the cell's column and row index, starting at zero. This can be used to implement striped tables.
#table(
fill: (col, _) => if calc.odd(col) { luma(240) } else { white },
align: (col, row) =>
if row == 0 { center }
else if col == 0 { left }
else { right },
columns: 4,
[], [*Q1*], [*Q2*], [*Q3*],
[Revenue:], [1000 €], [2000 €], [3000 €],
[Expenses:], [500 €], [1000 €], [1500 €],
[Profit:], [500 €], [1000 €], [1500 €],
)

align
autofunctionalignment2d alignmentSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.How to align the cell's content.
This can either be a single alignment or a function that returns an
alignment. The function is passed the cell's column and row index,
starting at zero. If set to auto
, the outer alignment is used.
stroke
How to stroke the cells.
This can be a color, a stroke width, both, or none
to disable
the stroke.
inset
relative lengthSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.How much to pad the cells's content.
The default value is 5pt
.