format_cells | R Documentation |
https://stackoverflow.com/questions/28166168/how-to-change-fontface-bold-italics-for-a-cell-in-a-kable-table-in-rmarkdown
format_cells(dat, rows, cols, fonttype)
dat |
A data.frame. |
rows |
The rows you want to apply formatting to. |
cols |
The columns you want to apply formatting to. |
fonttype |
fonttype = c("italics", "bold", "strikethrough"). |
df <- data.frame(char = c('a','b','c'),
num = c(1,2,3))
format_cells(df, 1, 1, "italics")
format_cells(df, 2, 2, "bold")
format_cells(df, 3, 1:2, "strikethrough")
library(knitr)
library(kableExtra)
library(magrittr)
df %>%
format_cells(1, 1, "italics") %>%
format_cells(2, 2, "bold") %>%
format_cells(3, 1:2, "strikethrough") %>%
knitr::kable()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.