Learn R Programming

kableExtra (version 0.3.0)

column_spec: Specify the look of the selected column

Description

This function allows users to select a column and then specify its look. Right now it supports the following three properties: column width, bold text and italic text.

Usage

column_spec(kable_input, column, width = NULL, bold = FALSE,
  italic = FALSE)

Arguments

kable_input

Output of knitr::kable() with format specified

column

A numeric value indicating which column to be selected. When you do the counting, ignore the extra header columns you added through add_header_left.

width

A character string telling HTML & LaTeX how wide the column needs to be, e.g. "10cm", "3in" or "30em".

bold

A T/F value to control whether the text of the selected column need to be bolded.

italic

A T/F value to control whether the text of the selected column need to be emphasized.

Examples

Run this code
# NOT RUN {
x <- knitr::kable(head(mtcars), "html")
column_spec(x, 1, width = "20em", bold = TRUE, italic = TRUE)

# }

Run the code above in your browser using DataLab