library(dplyr) library(huxtable) knitr::opts_chunk$set(echo = FALSE) options( huxtable.bookdown = TRUE, huxtable.add_colnames = TRUE ) long_caption <- 'This is a long caption. This is a long caption. This is a long caption. This is a long caption. This is a long caption. This is a long caption. This is a long caption. This is a long caption. This is a long caption.'
This is the layout I personally would like to use. But I feel like huxtable
's caption looks crammed:
head(mtcars[, 1:2], 10) %>% tibble::rownames_to_column() %>% as_huxtable() %>% theme_article() %>% huxtable::set_position("left") %>% set_caption(long_caption)
I would prefer it to span the whole width like this one by kable
(but without having the table also span the whole width):
knitr::kable( head(mtcars[, 1:2], 10), caption = long_caption )
More like in this figure:
plot(runif(10))
When using a centered layout I feel the same. This seems too crammed:
head(mtcars[, 1:2], 10) %>% tibble::rownames_to_column() %>% as_huxtable() %>% theme_article() %>% set_caption(long_caption)
This looks better:
plot(runif(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.