This function allows users to select a column and then specify its look.
column_spec(kable_input, column, width = NULL, bold = FALSE,
italic = FALSE, monospace = FALSE, underline = FALSE,
strikeout = FALSE, color = NULL, background = NULL,
border_left = FALSE, border_right = FALSE, extra_css = NULL)
Output of knitr::kable()
with format
specified
A numeric value or vector indicating which column(s) to be selected.
A character string telling HTML & LaTeX how wide the column needs to be, e.g. "10cm", "3in" or "30em".
A T/F value to control whether the text of the selected column need to be bolded.
A T/F value to control whether the text of the selected column need to be emphasized.
A T/F value to control whether the text of the selected column need to be monospaced (verbatim)
A T/F value to control whether the text of the selected row need to be underlined
A T/F value to control whether the text of the selected row need to be stricked out.
A character string for column text color. Here please pay attention to the differences in color codes between HTML and LaTeX.
A character string for column background color. Here please pay attention to the differences in color codes between HTML and LaTeX.
A logical variable indicating whether there should be a border line on the left of the selected column. In HTML, you can also pass in a character string for the CSS of the border line
A logical variable indicating whether there should be a border line on the right of the selected column. In HTML, you can also pass in a character string for the CSS of the border line
Extra css text to be passed into the cells of the row. Note that it's not for the whole column but to each individual cells
# NOT RUN {
x <- knitr::kable(head(mtcars), "html")
column_spec(x, 1:2, width = "20em", bold = TRUE, italic = TRUE)
# }
Run the code above in your browser using DataLab