Reputation: 109
Does anyone know how i can center the caption in the kable function?
This is my code:
Exhibit1 <- setDT(A)
colnames(A) = c(" ", "Nº Y", "Nº X")
Exhibit1 %>%
kbl(caption = "Database by Country") %>%
kable_classic(full_width = F, position = "center", html_font = "Times New Roman")
Any ideas, please?
PS. If anyone knows a better table generating function, you are welcome to share it with me... I just need a good design.
Thank you
Upvotes: 0
Views: 769
Reputation: 3677
Let's try the gt library
library(gt)
dt <- mtcars[1:5, 1:6]
testTable <- gt(dt)
testTable <-
testTable %>%
tab_header(title = md("**Title in the center of the table**")) %>%
tab_options(heading.title.font.size = px(18))
Upvotes: 0