knitr :: kable有没有办法减小字体大小? [英] knitr::kable is there a way to reduce the font size?
本文介绍了knitr :: kable有没有办法减小字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用此代码块
```{r, echo = FALSE}
knitr::kable(df)
```
但是,我想减小此表中所有字体的大小,以便输出看起来更好.有没有办法用kable做到这一点,或者有另一个支持它的软件包?
However I would like to reduce the size of all font inside this table so that the output looks nicer. Is there a way to do that with kable or is there another package which supports it?
推荐答案
您也可以尝试library(kableExtra)
.它有很多选项可以自定义表格.
You can also try library(kableExtra)
. It has a lot of options to customise the table.
具体来说,对于字体大小: https://haozhu233.github.io/kableExtra/awesome_table_in_html.html#font_size
Specifically, for font size: https://haozhu233.github.io/kableExtra/awesome_table_in_html.html#font_size
df %>%
kable("html") %>%
kable_styling(font_size = 7)
这篇关于knitr :: kable有没有办法减小字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文