How to make a table formatting condition for just one table?

If I’m understanding correctly, this is possible in Typst. This will set one default style of table which can be overridden at any time for one specific table.

#set table(gutter: 3em, columns: 2)

= Table 1
#table([a], [b], [c], [d])
= Table 2
#table(gutter: 0em, [a], [b], [c], [d])
Rendered

image

Or this which results in the same output as above but allows saving and reusing several styles of table.

#let table_wide = table.with(gutter: 3em, columns: 2)
#let table_narrow = table.with(gutter: 1em, columns: 2)

= Table 1
#table_wide([a], [b], [c], [d])
= Table 2
#table_narrow(gutter: 0em, [a], [b], [c], [d])
1 Like