简体   繁体   English

将有线表的样式设置为pdf

[英]Style a kable table knitted to pdf

I'm using kable to output a table from a data.frame in a R markdown document that is parsed to pdf. 我正在使用kable从解析为pdf的R markdown文档中的data.frame输出表。

This is the output: 这是输出: 在此处输入图片说明

I would like to style the table. 我想设计桌子的样式。 Specifically I'd like to: 具体来说,我想:

  • Increase cell height. 增加单元格高度。 The padding argument passed to kable() function didn't have effect. 传递给kable()函数的padding参数无效。
  • Make the headings bold. 使标题加粗。 (No idea about this). (对此一无所知)。

I call kaggle() in a function that is then called into the chunk in the .Rmd file. 我在函数中调用kaggle(),然后将其调用到.Rmd文件中的块中。

Thanks for your help 谢谢你的帮助

I don't know whether you tried already, but the kableExtra package offers a lot more features than kable. 我不知道您是否已经尝试过,但是kableExtra软件包比kable提供了更多的功能。 You could simply pipe your kable call into row specifications with 您可以简单地将有线电话插入行规范中,

%>% row_spec (0, bold = T)

I couldn't find an option for cell height there. 我在那里找不到单元格高度的选项。 In case you'd generally want to change it you could either pass it as an option into the YAML header or change the default.tex file. 如果通常要更改它,则可以将其作为选项传递到YAML标头中,也可以更改default.tex文件。

Regards 问候

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM