gpt4 book ai didi

右对齐 gt 中的 rowname_col

转载 作者:行者123 更新时间:2023-12-03 23:47:17 24 4
gpt4 key购买 nike

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

enter image description here

最佳答案

您可以像这样右对齐 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)
)

enter image description here

关于右对齐 gt 中的 rowname_col,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61880002/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com