简体   繁体   English

使用R中的flextable和Officer包从flextable删除所有行距

[英]Removing all line spacing from a flextable using flextable and officer packages in R

How do you remove all line spacing in a flextable when creating a flextable using the flextable package and printing it into a powerpoint document using the officer package in R? 当使用flextable包创建一个flextable并使用R中的Officer包将其打印到powerpoint文档中时,如何删除flextable中的所有行距?

By default it appears to have line spacing 1.0 with spacing 2 pt before and 2 pt after. 默认情况下,它看起来具有1.0的行距,前2 pt,后2 pt。 How do I get it so I have spacing 0 pt before and 0 pt after? 我如何得到它,所以我之前的间距为0 pt,之后的间距为0 pt?

Thanks a lot! 非常感谢!

You can use function padding for that: 您可以为此使用函数padding

library(flextable)
library(magrittr)

regulartable(head(iris)) %>% 
  padding(padding = 0, part = "all") %>% 
  autofit() %>% 
  print(preview = "pptx")

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

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