I was wondering if it might be possible to display more than one flextable
in the HTML format (on a single page) using flextable
and officer
?
library('flextable')
library('officer')
dat1 <- data.frame(Approaches = c("Y", "Y", "N"), Meets = c("N", "Y", "N"), row.names = c("Read", "Math", "Sci."))
dat2 <- data.frame(Read = "Y", Math = "N")
def_par <- fp_par(text.align = "center")
def_txt <- fp_text(bold = TRUE)
ft <- flextable(dat1, cwidth = c(3.2, 3.2)) # Table #1
ft <- style(ft, pr_p = def_par, part = "all")
ft <- style(ft, pr_t = def_txt, part = "header")
tit <- c("Domain 1 and Domain 2B", "Domain 2A")
ft <- set_caption(ft, tit[1])
ft <- add_footer_lines(ft, values = "") # add a line break
flextable(dat2, cwidth = c(3.2, 3.2)) # Table #2
flextable
there is a way to directly get 2 tables in one HTML without using knitr. But I have upvoted your kind effort here. – Ungenerous