add caption to flextable in docx

牧云@^-^@ 提交于 2019-12-10 15:37:11

问题


How could one add a caption to a flextable rendered to docx? EDIT: The aim is to produce a proper caption which can be referenced within the document to produce a list of tables and inline references.

iris.t <-
  iris[1:5,] %>%
  regulartable() %>% 
  style(pr_c = officer::fp_cell(vertical.align = "bottom",
                                border.bottom = officer::fp_border(width = 2)), part = "header") %>% 
  rotate(j = names(iris)[-c(1:2)],
         rotation = "tbrl", part = "header", align = "bottom") %>% 
  height(height = max(dim_pretty(., part = "header")$widths), part = "header") %>% 
  width(width = dim_pretty(.,part = "body")$widths)

iris.t 

来源:https://stackoverflow.com/questions/49676982/add-caption-to-flextable-in-docx

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