This function allows users to select a row and then specify
its look. It can also specify the format of the header row when row = 0.
row_spec(
  kable_input,
  row,
  bold = FALSE,
  italic = FALSE,
  monospace = FALSE,
  underline = FALSE,
  strikeout = FALSE,
  color = NULL,
  background = NULL,
  align = NULL,
  font_size = NULL,
  angle = NULL,
  extra_css = NULL,
  hline_after = FALSE,
  extra_latex_after = NULL
)Output of knitr::kable() with format specified
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.
A T/F value to control whether the text of the selected row need to be bolded.
A T/F value to control whether the text of the selected row need to be emphasized.
A T/F value to control whether the text of the selected row 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 row text color. For example, "red" or "#BBBBBB".
A character string for row background color. Here please pay attention to the differences in color codes between HTML and LaTeX.
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.
A numeric input for font size. For HTML, you can also use
options including xx-small, x-small, small, medium, large,
x-large, xx-large, smaller, larger, initial and inherit.
0-360, degree that the text will rotate.
Extra css text to be passed into the cells of the row. Note that it's not for the whole row.
T/F. A replicate of hline.after in xtable. It
addes a hline after ther row
Extra LaTeX text to be added after the row. Similar
with add.to.row in xtable
if (FALSE) {
x <- knitr::kable(head(mtcars), "html")
row_spec(x, 1:2, bold = TRUE, italic = TRUE)
}
Run the code above in your browser using DataLab