Skip to contents

Generates Typst code from a typst_table object. This is called automatically by print() and knit_print(), but can also be called directly.

Usage

tt_render(table)

Arguments

table

A typst_table object.

Value

A character string containing Typst table markup.

Examples

code <- tt(mtcars[1:3, 1:3], rownames = FALSE) |> tt_render()
cat(code)
#> #table(
#>   columns: (1fr, 1fr, 1fr),
#>   stroke: none,
#>   table.hline(stroke: 1pt),
#>   [mpg], [cyl], [disp],
#>   table.hline(stroke: 0.5pt),
#>   [21], [6], [160],
#>   [21], [6], [160],
#>   [22.8], [4], [108],
#>   table.hline(stroke: 1pt)
#> )