The advantage with respect to theme_htmlTable(caption = "My table") is that this works with HTML and LaTeX outputs
theme_caption(x, caption = "")data(iris)
cf <- condformat(head(iris)) |>
theme_caption(caption = "My Caption")
if (FALSE) { # \dontrun{
print(cf)
} # }