R 向表中添加标题
我想在桌子的顶部/底部添加标题。R 向表中添加标题,r,gt,R,Gt,我想在桌子的顶部/底部添加标题。gt包中是否有标题功能 gt(head(mtcars)) %>% tab_header(title="", subtitle="Table 1: Mtcars with gt.") %>% tab_options(table.width=pct(90), table.border.top.style=0,
gt
包中是否有标题功能
gt(head(mtcars)) %>%
tab_header(title="", subtitle="Table 1: Mtcars with gt.") %>%
tab_options(table.width=pct(90),
table.border.top.style=0,
row.padding=px(4)) %>%
tab_style(style=cells_styles(
text_align='left',
text_color='grey'),
locations=cells_title(groups="subtitle"))
通过从Github安装包的开发版本,我可以获得caption
参数
#devtools::install_github("rstudio/gt")
library(gt)
gt(head(mtcars), caption = 'This is table caption') %>%
tab_header(title="A", subtitle="Table 1: Mtcars with gt.")
标题是否可以左对齐而不是居中?我找不到标题的对齐选项。