I use kableExtra package to create some html format files.
And I use hold_position to change the caption location but it doesn't work.
The reproducible code below came from the kableExtra package official samples:
kbl(dt, caption = "Demo table", booktabs = T) %>%
kable_styling(latex_options = c("striped", "hold_position"))
Since your output is html, you could add <center>text<\center>
to your caption:
library(tidyverse)
library(kableExtra)
kbl(mtcars, caption = "<center>Demo table</center>", booktabs = T) %>%
kable_styling(latex_options = "striped")
-output