How to knit_print flextable with loop in a rmd file
I am trying to produce mutltiple tables using the flextable and kable packages. When I want to output some table iteratively, I found knit_print of flextable is not working in loop. Below is a minimal example: --- output: word_document --- ```{r} library(flextable) library(knitr) ``` ```{r} data(cars) speed<-unique(cars$speed) for (v in 1:length(speed)) { carspd<-cars[which(cars$speed==speed[v]),] tb<-regulartable(carspd) knit_print(tb) } knit_print(tb) ``` Just the last knit_print can print the result to the word_document with the .Rmd file. Now I find the difference of them in .md which is