Skip to content

Is there a way to output table cells in a for loop? #830

Discussion options

You must be logged in to vote

You can use the spread operator .. like this:

#table(columns: 2,
..(for a in range(1, 11) { ([#a], ) }))
                           /*   ^-- Note the trailing comma to create an array with one item */

All arrays returned by for are joined into one single array, which then is spread using ...

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cds-internationalist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants