Skip to contents

Extracts the list of cell style overrides applied via fr_styles(). Each element is an fr_cell_style object describing the target region, rows, columns, and style properties (bold, fg, bg, etc.).

Usage

fr_get_styles(spec)

Arguments

spec

An fr_spec object from fr_table() or fr_listing().

Value

A list of fr_cell_style objects. Empty list if no styles are applied.

See also

fr_styles() to apply styles, fr_style(), fr_row_style(), fr_col_style() for style constructors.

Examples

spec <- tbl_demog |> fr_table() |>
  fr_styles(
    fr_row_style(rows = 1L, bold = TRUE),
    fr_col_style(cols = "total", bg = "#EBF5FB")
  )
styles <- fr_get_styles(spec)
length(styles)           # 2
#> [1] 2