bcat_fmt_style_table: UC table formatting

View source: R/bcat_fmt_style_table.R

bcat_fmt_style_tableR Documentation

UC table formatting

Description

Format tables for output to final documentation. Automatically detects output format (HTML, PDF, Word, PPTX) and applies UC styling.

Usage

bcat_fmt_style_table(
  df,
  caption = NULL,
  footer = NULL,
  header = NULL,
  header_bg_color = palette_UC[["UC Red"]],
  header_txt_color = palette_UC[["White"]],
  align,
  font_size = 12,
  striped = TRUE,
  full_width = FALSE,
  scale_down = FALSE,
  longtable = FALSE,
  col_names = NA,
  threeparttable = FALSE,
  doc_type = c(knitr::opts_knit$get("rmarkdown.pandoc.to"), "html", "pdf", "docx",
    "pptx"),
  ...
)

Arguments

df

Data frame to format.

caption

Character. Table caption.

footer

Character. Table footnote.

header

Character. Spanning header text above all columns.

header_bg_color

Background fill color for header. Default is UC Red.

header_txt_color

Text color for header. Default is white.

align

Character vector of column alignments: 'l' (left), 'c' (center), 'r' (right).

font_size

Numeric. Font size for table. Default is 12.

striped

Logical. Enable zebra striping? Default is TRUE.

full_width

Logical. Should HTML table be full width? Default is FALSE.

scale_down

Logical. Scale LaTeX table to fit page? Default is FALSE.

longtable

Logical. Use longtable for multi-page PDF tables? Default is FALSE.

col_names

Character vector of column names. Set to NULL to remove header row.

threeparttable

Logical. Use LaTeX threeparttable for footnotes? Default is FALSE.

doc_type

Manually set document type. Auto-detected if not specified.

...

Additional arguments passed to knitr::kable.

Value

A formatted table object (kableExtra for HTML/PDF, flextable for Word/PPTX).

Author(s)

Saannidhya Rawat

See Also

Other tables: bcat_cor_table(), bcat_reg_table(), bcat_sum_table()

Examples

bcat_fmt_style_table(iris[1:10, ])
bcat_fmt_style_table(iris[1:5, ], caption = "Iris Sample", striped = TRUE)

Rbearcat documentation built on March 21, 2026, 5:07 p.m.