Is it possible to format captions in kableExtra? I would like to center and bold a caption for a table when knitting to HTML in RMarkdown. I have tried to wrap the table in a CSS div where the text was centered, but this did not produce the intended result.
Sample table:
library(kableExtra)
kable(data.frame(a = 1:3, b = 4:6), caption = "CENTER") %>%
kable_styling(bootstrap_options = "striped")
Yields:

I would like:

If the final format is HTML:
write caption within HTML center and strong tag and set escape to FALSE.
kable(
data.frame(a = 1:3, b = 4:6),
caption = "<center><strong>CENTER</strong></center>",
escape = FALSE,
format = "html"
) %>%
kable_styling(bootstrap_options = "striped")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With