title: Displaying multiple dygraphs on a grid in R-Markdown
body: <p>Following the conversation <a href="https://stackoverflow.com/questions/30509866/for-loop-over-dygraph-does-not-work-in-r">here</a>, is there a way to organize the output dygraphs in a grid? To Have one or more graph in a row.</p>
  
  <p>The code below would generate 4 dygraphs arranged vertically.
  Is there a way to organize them in a 4x4 grid?</p>
  
  <p>I tried using <code>tags$div</code> but it wraps all the graphs in one div.
  Is there a way to apply a CSS property such as <code>display: inline-block;</code> to each dygraph widget? or any other better method?</p>
  
  <pre><code>```{r}
  library(dygraphs)
  library(htmltools)
  
  
  makeGraphs = function(i){
    dygraph(lungDeaths[, i], width = 300, height = 300, group = "lung-deaths")%&gt;%
      dyOptions(strokeWidth = 3) %&gt;%
      dyRangeSelector(height = 20)
  }
  
  
  lungDeaths &lt;- cbind(mdeaths, fdeaths, ldeaths, mdeaths)
  res &lt;- lapply(1:4, makeGraphs )
  htmltools::tagList(tags$div(res, style = "width: 620px; padding: 1em; border: solid; background-color:#e9e9e9"))
  ```
  </code></pre>
  
  <p>Current output screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/bPijc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bPijc.png" alt="enter image description here"></a></p>