I'm trying to apply a Word style (table or paragraph) to a flextable object. My motivation is to find a way to stop a flextable from splitting across rows at a page break when outputted to a Word .docx document via knitr. For example, in the following code I've attempted to apply the "Table of Figures" paragraph style to a flextable in R markdown:
---
title: " "
output:
word_document: default
---
<div custom-style = "Table of Figures">
```{r, echo = F, message = F}
library(flextable)
library(magrittr)
head(cars) %>%
regulartable
```
</div>
However, this doesn't seem to work. Does anyone know how to apply table and/or paragraph styles to a flextable object?