kable_centered <- function(table){
# Print a kable centered with column width shrunk to fit.
#
# Arguments:
# table {dataframe} -- dataframe to display
#
# Function Dependencies:
# - knitr
#
# Returns:
# {knitr::kable}
library(knitr)
stopifnot(is.data.frame(table))
knitr::kable(
table,
format = "html",
align = "l"
) %>%
kable_styling(
bootstrap_options = "striped",
full_width = FALSE
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.