alignment of a flextable on the page when rendering R Markdown to MS Word

你说的曾经没有我的故事 提交于 2020-06-27 13:08:59

问题


I've been having great luck with customizing flextable tables in my R Markdown documents. However, I am struggling to change the location of a table on the page. It seems the tables are centered on the page by default. I'd like one of my tables aligned to the left margin. How do I do that?


回答1:


I have just added an option to enable that. Now you can use chunk option ft.align

---
output: word_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```


```{r ft.align="left"}
library(flextable)
regulartable(cars)
```



回答2:


I ran into the same problem and the solution worked just fine after updating "flextable" from 0.5.4 and 0.5.5 to get this to work.



来源:https://stackoverflow.com/questions/52376149/alignment-of-a-flextable-on-the-page-when-rendering-r-markdown-to-ms-word

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!