-
-
Notifications
You must be signed in to change notification settings - Fork 214
Table generation
Giorgio Garofalo edited this page Oct 18, 2025
·
1 revision
The .table function takes a single block argument which is an iterable of tables.
The result of the call is a new table which is the combination, by columns of the supplied tables.
In the following example .repeat is used, which, as other supported loops do, returns the results from each iteration as an iterable.
.table
.repeat {3}
n:
| Column .n |
|-----------|
| Cell .n:1 |
| Cell .n:2 |
| Cell .n:3 |
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| Cell 1:1 | Cell 2:1 | Cell 3:1 |
| Cell 1:2 | Cell 2:2 | Cell 3:2 |
| Cell 1:3 | Cell 2:3 | Cell 3:3 |
The .tablebyrows[docs] function
takes two arguments: an optional iterable of headers and an iterable of rows.
.var {headers}
- Name
- Age
- City
.tablebyrows {.headers}
- - John
- 25
- NY
- - Lisa
- 32
- LA
- - Mike
- 19
- CHI| Name | Age | City |
|---|---|---|
| John | 25 | NY |
| Lisa | 32 | LA |
| Mike | 19 | CHI |
.tablebyrows
.repeat {3}
y:
.repeat {3}
x:
Cell .x:.y
| Cell 1:1 | Cell 2:1 | Cell 3:1 |
| Cell 1:2 | Cell 2:2 | Cell 3:2 |
| Cell 1:3 | Cell 2:3 | Cell 3:3 |
- Figures
- Image size
- TeX formulae
- Table caption
- Code caption
- Decorative headings
- Alerts (quote types)
- Quotation source
- Cross-references
- Page breaks
- Text symbols (text replacement)
- Emojis
- Document metadata
- Theme
- CSS
- Fonts
- Page format
- Page margin content
- Page counter
- Persistent headings
- Automatic page break
- Numbering
- Paragraph style
- Caption position
- Table of contents
- Bibliography
- Footnotes
- Stacks (row, column, grid)
- Container
- Align
- Float
- Figure
- Clip
- Box
- Collapsible
- Landscape
- Whitespace
- Variables
- Optionality
- Math
- Conditional statements
- Loops
- Let
- Destructuring
- String manipulation
- Table manipulation: sorting, computing, and more
- Table generation
- String
- Number
- Markdown content
- Boolean
- None
- Enumeration entry
- Iterable
- Dictionary
- Range
- Lambda
- Size(s)
- Color
- Dynamic
- Paper: abstract, definitions, theorems, and more