fmt_kbl_header: Wrapper function of kableExtra::row_spec

View source: R/kbl-defaults.R

fmt_kbl_headerR Documentation

Wrapper function of kableExtra::row_spec

Description

Apply some default formatting to the header row of a kable table. Should be called after any calls to kableExtra::column_spec().

Usage

fmt_kbl_header(
  kable_input,
  row = 0,
  align = "c",
  extra_css = "border-bottom: 0.16em solid #111111",
  ...
)

Arguments

kable_input

Output of knitr::kable() with format specified

row

A numeric value or vector indicating which row(s) to be selected. You don't need to count in header rows or group labeling rows.

align

A character string for cell alignment. For HTML, possible values could be l, c, r plus left, center, right, justify, initial and inherit while for LaTeX, you can only choose from l, c & r.

extra_css

Extra css text to be passed into the cells of the row. Note that it's not for the whole row.

...

Additional arguments passed to kableExtra::row_spec()

Value

A kable object.

Examples

fmt_kbl(mtcars[, 1:3], align = c("r", "c", "r"),
    col.names = c("Column 1", "Column 2", "Column 3"),
    caption = "Example Table Title") |>
  kableExtra::column_spec(1, width = "20em") |>
  fmt_kbl_header()

ratlas documentation built on April 4, 2025, 12:22 a.m.