Learn R Programming

kableExtra (version 1.4.0)

add_indent: Add indentations to row headers

Description

Add indentations to row headers

Usage

add_indent(
  kable_input,
  positions,
  level_of_indent = 1,
  all_cols = FALSE,
  target_cols = 1
)

Arguments

kable_input

Output of knitr::kable() with format specified

positions

A vector of numeric row numbers for the rows that need to be indented.

level_of_indent

a numeric value for the indent level. Default is 1.

all_cols

T/F whether to apply indentation to all columns

target_cols

A vector of numeric column positions. Default is 1.

Examples

Run this code
if (FALSE) {
x <- knitr::kable(head(mtcars), "html")
# Add indentations to the 2nd & 4th row
add_indent(x, c(2, 4), level_of_indent = 1)
}

Run the code above in your browser using DataLab