Are you after modify_header()
?
library(dplyr)
library(gtsummary)
library(ggplot2)
mpg %>%
select(manufacturer, drv) %>%
tbl_summary(by = drv,
digits=list(all_categorical() ~ c(function(x){round(x/5) * 5}, 0)),
type = list(displ = "continuous2")) %>%
modify_header(all_stat_cols() ~ "**{level}** \n\n **N = {round(n/5)*5}**")
Gives:
(output truncated)