Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

r

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?

like image 392
JD Long Avatar asked Sep 17 '18 21:09

JD Long


1 Answers

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)
```
like image 150
David Gohel Avatar answered Nov 15 '22 17:11

David Gohel