View source: R/bcat_fmt_style_table.R
| bcat_fmt_style_table | R Documentation |
Format tables for output to final documentation. Automatically detects output format (HTML, PDF, Word, PPTX) and applies UC styling.
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"),
...
)
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 |
A formatted table object (kableExtra for HTML/PDF, flextable for Word/PPTX).
Saannidhya Rawat
Other tables:
bcat_cor_table(),
bcat_reg_table(),
bcat_sum_table()
bcat_fmt_style_table(iris[1:10, ])
bcat_fmt_style_table(iris[1:5, ], caption = "Iris Sample", striped = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.