7b56569 ←9152b37antonApr 18, 2026 api

create tables.typ via macOS

A /docs/undefined +53 -0
A /docs/undefined +53 -0
1= Tables
2
3Typst tables use the `#table` function with flexible column definitions.
4
5== Basic table
6
7#table(
8 columns: 3,
9 [*Name*], [*Language*], [*Year*],
10 [Typst], [Rust], [2023],
11 [LaTeX], [TeX], [1984],
12 [Markdown], [Perl], [2004],
13)
14
15== Column sizing
16
17Fixed and fractional widths:
18
19#table(
20 columns: (120pt, 1fr, 1fr),
21 [*Feature*], [*Typst*], [*LaTeX*],
22 [Compilation], [Fast, incremental], [Slow, full rebuild],
23 [Syntax], [Clean markup], [Verbose macros],
24 [Math], [Native support], [Native support],
25 [Scripting], [Built-in], [Limited],
26)
27
28== Styled table
29
30#table(
31 columns: (1fr, 1fr, 1fr),
32 fill: (x, y) => if y == 0 { luma(230) } else if calc.odd(y) { luma(245) } else { white },
33 align: (left, center, right),
34 [*Item*], [*Quantity*], [*Price*],
35 [Widget A], [150], [\$12.99],
36 [Widget B], [89], [\$24.50],
37 [Widget C], [312], [\$7.25],
38 [Widget D], [45], [\$99.00],
39)
40
41== Table with spanning
42
43#table(
44 columns: 4,
45 table.header(
46 table.cell(colspan: 4, align: center)[*Quarterly Revenue (\$M)*],
47 [*Region*], [*Q1*], [*Q2*], [*Q3*],
48 ),
49 [North], [12.4], [15.1], [14.8],
50 [South], [8.7], [9.2], [11.3],
51 [East], [21.0], [19.8], [22.5],
52 [West], [15.3], [16.7], [18.1],
53)