简体   繁体   English

有没有办法在 rmarkdown pdf 中使用 kable extra 为表格边框添加颜色?

[英]Is there a way to add color to borders of table using kable extra in rmarkdown pdf?

I want full borderd table and make the lines of border to be green.我想要完整的边框表格并使边框线为绿色。 i didn't find any attributes to make the lines to greeen in column_spec or row_spec.我没有找到任何属性来使 column_spec 或 row_spec 中的线条变绿。

'kbl(df,booktabs = T,longtable = T,align = c("l", "c", "c", "c")) %>%
kable_styling(latex_options = c("hold_position","repeat_header"),bootstrap_options = "bordered",full_width = F)%>%
  column_spec(1, width = "8.5cm",border_left = T, border_right = T)%>%
  column_spec(2:4, width = "2.5cm", border_right = T)%>%
  collapse_rows(latex_hline = "full")%>%
  row_spec(0, bold = T, color = "white", background = "#008752")

how can i remove gap between the border lines我怎样才能消除边界线之间的差距

在此处输入图像描述

You can add你可以加

\usepackage{colortbl}
\arrayrulecolor{green}

to your header includes to change the line colour to green到您的 header 包括将线条颜色更改为绿色

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有办法为 pdf 制作没有线条/边框的 kable? - Is there a way to make a kable without lines/borders for pdf? 使用rownames = TRUE(rmarkdown,kable和kableExtra)在乳胶中呈现具有条件颜色的表作为pdf文档 - Rendering Table with conditional color in latex as a pdf document with rownames = TRUE (rmarkdown, kable and kableExtra ) 如何使用 kable 在我的 Rmarkdown 表中的单元格中添加希腊字母? - How can I add greek letters to cells in my Rmarkdown table using kable? 为什么使用 RMarkdown 将 plot 放在 pdf 中的 kable 之前 - Why is plot put before kable in pdf using RMarkdown Rmarkdown 中使用 Kable 为特定单元格着色 - Especific cells color with Kable in Rmarkdown 为 Rmarkdown 格式化为 kable / kableExtra 的表格的一个单元格添加上标 - Add a superscript to one cell of a table formatted with kable / kableExtra for Rmarkdown rmarkdown & kable/kableextra:使用 escape = F 时在表中打印 % 符号 - rmarkdown & kable/kableextra: Printing % symbol in Table when using escape = F “语音标记”(反逗号)在 LaTeX output(rmarkdown kable 额外脚注)中面对错误的方式 - "Speech marks" (inverted commas) facing wrong way round in LaTeX output (rmarkdown kable extra footnote) RMarkdown:Kable每行颜色最大百分比? - RMarkdown: Color largest percentage in each row of Kable? RMarkdown:无法引用 `knitr::kable` 表的 label - RMarkdown: cannot reference the label of a `knitr::kable` table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM