我想要右对齐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))

发布于 2020-05-19 17:28:52
您可以像这样右对齐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)
)

https://stackoverflow.com/questions/61880002
复制相似问题