Hopefully this is not something very obvious I missed, but I am having a hard time finding how to format the caption of gtsummary tables.
I am trying to reproduce the table found here. I love the left aligned grey caption: https://www.danieldsjoberg.com/gtsummary/articles/tbl_summary.html#gtsummary-functions-to-format-table
I am using the following code, but the caption Table 1. Patient Characteristics
is shown centered and in black ink, but in the example is left aligned and grey.
How can you format the caption of the gtsummary tables?
library(gtsummary)
trial2 <- trial %>% select(trt, age, grade)
trial2 %>%
tbl_summary(by = trt) %>%
add_p(pvalue_fun = ~style_pvalue(.x, digits = 2)) %>%
add_overall() %>%
add_n() %>%
modify_header(label ~ "**Variable**") %>%
modify_spanning_header(c("stat_1", "stat_2") ~ "**Treatment Received**") %>%
modify_footnote(
all_stat_cols() ~ "Median (IQR) or Frequency (%)"
) %>%
modify_caption("**Table 1. Patient Characteristics**") %>%
bold_labels()