theme_tt {tinytable}R Documentation

Themes for tinytable

Description

A theme is a function which applies a collection of transformations to a tinytable object. Whereas the other tinytable functions such as format_tt() and style_tt() aim to be output-agnostic, themes can be output-specific, only applying to LaTeX, HTML, or Typst, as needed.

Each theme can have specific arguments, which are passed to the theme_tt() function. See the "Arguments" section below.

Usage

theme_tt(x, theme, ...)

Arguments

x

A tinytable object

theme

String. Name of the theme to apply. One of:

  • "grid": Vertical and horizontal rules around each cell.

  • "void": No rules

  • "bootstrap": Similar appearance to the default Bootstrap theme in HTML

  • "striped": Grey stripes on alternating rows

  • "tabular": No table environment (LaTeX) or Javascript/CSS (HTML)

  • "resize": Scale a LaTeX tinytable to fit the width argument.

  • "multipage": Long tables continue on the next page (LaTeX only)

  • "placement": Position of the table environment (LaTeX)

...

Additional arguments passed the themeing function. See the "Arguments" section below for a list of supported arguments for each theme.

Value

A modified tinytable object

Arguments

resize

multipage

placement

Examples

library(tinytable)

x <- mtcars[1:4, 1:4]

# equivalent calls
tt(x, theme = "striped")

tt(x) |> theme_tt("striped")

# resize w/ argument
x <- cbind(mtcars[1:10,], mtcars[1:10,])
tt(x) |>
  theme_tt("resize", width = .9) |>
  print("latex")


[Package tinytable version 0.2.1 Index]