| keep_with_next | R Documentation |
The 'Keep with next' functionality in 'Word', applied to the rows of a table, ensures that rows with that attribute stay together and do not break across multiple pages.
This function provides better control of page breaks than
the global keep_with_next parameter.
keep_with_next(x, i = NULL, value = TRUE, part = "body")
x |
a 'flextable' object, see flextable-package to learn how to create 'flextable' object. |
i |
row selector, see section Row selection with the |
value |
TRUE or FALSE. When applied to a group, all rows except the last one should be flagged with the 'Keep with next' attribute. |
part |
part selector, see section Part selection with the |
paginate()
Other formatting shortcuts:
align(),
bg(),
bold(),
color(),
empty_blanks(),
font(),
fontsize(),
highlight(),
italic(),
line_spacing(),
padding(),
rotate(),
style(),
tab_settings(),
valign()
library(flextable)
dat <- iris[c(1:25, 51:75, 101:125), ]
ft <- qflextable(dat)
ft <- keep_with_next(
x = ft,
i = c(1:24, 26:49, 51:74),
value = TRUE
)
save_as_docx(ft, path = tempfile(fileext = ".docx"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.