Chaochao Ma kable() function in R is used to create formatted tables. When combined with a for loop, it allows you to generate and display multiple tables. Within the loop, you would typically extract the relevant data for each iteration, use kable() to format the data into a table, and then display or print the table.
The answer to your problem somewhat depends on your output device. Word documents handle a rapid succession of kable commands somewhat different than say HTML pages. So what are you aiming for?
When using 'print' enclosing the 'kable()' command, avoid using 'format="latex"'. Instead, even producing a 'latex' markdown, don't specify any format and add '{r, result="asis"}' in the chunk header. This should work properly.