【发布时间】:2022-01-18 03:01:53
【问题描述】:
我在 Rmarkdown 中使用flextable() 来创建表格。我将我的代码编织到 word_document 输出。有谁知道如何使表格的宽度不适合内容,而是适合 word_document 输出中侧边框的宽度?
---
title: ""
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(flextable)
library(dplyr)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
head(cars)%>%
flextable()%>%
theme_box()%>%
autofit()
```
下面我附上两张图:
谢谢!
【问题讨论】:
标签: r r-markdown flextable