Set Caption
Set caption value in a flextable.
The caption will be associated with a paragraph style when the output is Word. It can also be numbered as a auto-numbered Word computed value.
The PowerPoint format ignores captions.
set_caption( x, caption, autonum = NULL, style = "Table Caption", html_escape = TRUE )
x |
flextable object |
caption |
caption value |
autonum |
an autonum representation. See |
style |
caption paragraph style name. These names are available with
function |
html_escape |
should HTML entities be escaped so that it can be safely included as text or an attribute value within an HTML document. |
flextable captions can be defined from R Markdown documents by using
knitr::opts_chunk$set()
. The following options are available:
label | name | value |
Word stylename to use for table captions. | tab.cap.style | NULL |
prefix for numbering chunk (default to "Table "). | tab.cap.pre | Table |
suffix for numbering chunk (default to ": "). | tab.cap.sep | " :" |
title number depth | tab.cap.tnd | 0 |
separator to use between title number and table number. | tab.cap.tns | "-" |
caption prefix formatting properties | tab.cap.fp_text | fp_text_lite(bold = TRUE) |
caption id/bookmark | tab.id | NULL |
caption | tab.cap | NULL |
display table caption on top of the table or not | tab.topcaption | TRUE |
caption table sequence identifier. | tab.lp | "tab:" |
See knit_print.flextable for more details.
ftab <- flextable( head( iris ) ) ftab <- set_caption(ftab, "my caption") ftab library(officer) autonum <- run_autonum(seq_id = "tab", bkm = "mtcars") ftab <- flextable( head( mtcars ) ) ftab <- set_caption(ftab, caption = "mtcars data", autonum = autonum) ftab
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.