Rmarkdown 2 column layout in a loop

i'm trying to make a loop with 2 column in rmarkdown html :

  • two column in each chapter
  • chapter made by the loop insideR ,results='asis' loop i tried to combine multi column and loop and it's not working
    i'm tryng some frankenstein code with raw html in asis chunk and it's not working
---
title: "test"
output: html_document
---


```{r , echo=FALSE , results='asis'}

for (i in 1:2){
    cat(' \n# titre ', i , " \n ") 
cat("htmltools::HTML('<div style=\"display: flex;\">')" , " \n ")  
cat("blabla col 1" , ' \n')
cat("htmltools::HTML('</div>')" , " \n ")
cat("htmltools::HTML('<div>')" , " \n ")
cat("blabla col 2" , ' \n')
cat("htmltools::HTML('</div>')" , " \n ")
cat("htmltools::HTML('</div>')" , " \n ")
}
  
```


Read more here: https://stackoverflow.com/questions/65917931/rmarkdown-2-column-layout-in-a-loop

Content Attribution

This content was originally published by s.brunel at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: