如何使用 kableextra 绘制的表格中的文本居中?
Posted
技术标签:
【中文标题】如何使用 kableextra 绘制的表格中的文本居中?【英文标题】:How to center text in a table drawn with kableextra? 【发布时间】:2021-09-03 20:50:16 【问题描述】:有人知道如何使表格中的文本居中吗?
Mod <- c("1","1b","2","2b","3 ","3b")
Lag <- c("1","1","1","1","1","1")
dt <- data.frame(cbind(Mod,Lag))
dt %>%
kbl() %>%
kable_classic(full_width = T, html_font = "Cambria")
【问题讨论】:
【参考方案1】:Mod <- c("1","1b","2","2b","3 ","3b")
Lag <- c("1","1","1","1","1","1")
dt <- data.frame(cbind(Mod,Lag))
dt %>%
kbl() %>%
kable_classic(full_width = T, html_font = "Cambria")%>%row_spec(0:6, align = "c")
【讨论】:
以上是关于如何使用 kableextra 绘制的表格中的文本居中?的主要内容,如果未能解决你的问题,请参考以下文章