将R Markdown渲染到MS Word时页面上的弹性表格对齐 [英] alignment of a flextable on the page when rendering R Markdown to MS Word

查看:187
本文介绍了将R Markdown渲染到MS Word时页面上的弹性表格对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在R Markdown文档中自定义flextable表一直很幸运.但是,我正在努力更改表在页面上的位置.默认情况下,表格似乎位于页面的中心.我想要一张桌子对准左边距.我怎么做?

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?

推荐答案

我刚刚添加了启用它的选项.现在您可以使用块选项ft.align

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)
```

这篇关于将R Markdown渲染到MS Word时页面上的弹性表格对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆