Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想右对齐,rowname_col但看起来你不能应用于cols_align行名?
rowname_col
cols_align
tibble( one = c("Long names", "Other Name", "Name | Name"), two = 1:3 ) %>% gt(rowname_col = "one") %>% cols_align(align = "right", columns = vars(one))
您可以像这样右对齐 rowname 列:
library(dplyr) library(gt) tibble( one = c("Long names", "Other Name", "Name | Name"), two = 1:3 ) %>% gt(rowname_col = "one") %>% tab_style( style = list( cell_text(align = "right") ), locations = cells_stub(rows = TRUE) )