Closed erydit closed 1 year ago
I think best is to stop using captions.
This is just a paragraph, add a paragraph before or after the table and that's it.
The expected behavior is now back (https://github.com/davidgohel/flextable/commit/fb7bd2bbcb18172d221ecc2cd2a23f432592c711). If you only need a simple caption in a Word document (from read_docx()
) you can also replace caption with a simple paragraph associated with your caption style, i.e.:
library(officer)
library(flextable)
ft <- iris %>% flextable()
x <- read_docx()
x <-
x <- body_add_flextable(x, value = ft)
x <- body_add_par(x, value = "flxname", style = "Table Caption")
print(x, "x.docx")
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Hello again!
flextable_0.8.5 officer_0.5.2
When I save a flextable with a caption to docx using body_add_flextable(), a word "Table: " adds to a caption in the resulted document.
Code:
And in Word i get:
But I expect the caption without "Table: ". The "Table: " also adds if i use a template with predefined styles for table captions. Previous versions of flextable and officer worked as expected. In addition, now Word ask "The document contains fields that link to other files." at every opening of the generated file. That behavior also have come with the last updates.
resulted.docx