title: Output more than 1 datatables in shiny main panel
body: <p>I have a shiny app that a user can check whether they want the data table displayed in the main panel. Depending on the numericinput, if they select 1, only 1 datatable be displayed or if they select 2 it will display 2 datatables I am not so sure how to code this in shiny R since I am new to this. Thank you for looking into this.
  Here is my code</p>
  
  <pre><code>library("shiny")
  df1 &lt;- data.frame("2010-01"=double(),
            "2010-02"=double(),
            "2010-03"=double(),
            "2010-04"=double()
            )
  
  df1&lt;-rbind(df1,setNames(as.list(c(10,20,30,40)), names(df2)))
  
  df2 &lt;- data.frame("2010-01"=double(),
            "2010-02"=double(),
            "2010-03"=double(),
            "2010-04"=double()
            )
  
  df2&lt;-rbind(df2,setNames(as.list(c(100,200,300,400)), names(df2)))
  
  df3 &lt;- data.frame("2010-01"=double(),
            "2010-02"=double(),
            "2010-03"=double(),
            "2010-04"=double()
            )
  
  df3&lt;-rbind(df3,setNames(as.list(c(1000,2000,3000,4000)), names(df2)))
  
  ui &lt;-fluidPage(
   sidebarPanel(
     checkboxInput("add_data", "Add Data Table(s)"),
     conditionalPanel(condition="input.add_data === true",
               numericInput("numofdata",
                            label="Number of Data Table(s):",
                            min = 1,
                            max = 3,
                            value = 1,
                            step = 1),
               uiOutput("num_of_data"),
               textOutput("see_ranges")
              ),
  
      actionButton("submit", "Submit")
   ),
  
   mainPanel(
  
   titlePanel("Output Data Table"),
  
   DT::dataTableOutput("datatable.view", width = "95%")
  
   ) # end of main panel
  )
  
  server &lt;- function(input, output, session) {
  
    output$num_of_data &lt;- renderUI({
      lapply(1:input$numofdata, function(i) {
      print(trend_list())
    })
   })
  
  
   output$see_ranges &lt;- renderPrint({
    print(trend_list())
   })
  
    data.filter &lt;- reactive({
  
      df(i) 
    })
  
  output$datatable.view &lt;- DT::renderDataTable(
  {
  input$submit 
  if (input$submit==0) return()
  
  isolate({
  for(i in 1:input$numoftrends) {
    datatable(data.filter(i), 
              rownames=FALSE,
              extensions = c("FixedColumns", "FixedHeader", "Scroller"), 
              options = list(searching=FALSE,
                             autoWidth=TRUE,
                             rownames=FALSE,
                             scroller=TRUE,
                             scrollX=TRUE,
                             pagelength=1,
                             fixedHeader=TRUE,
                             class='cell-border stripe',
                             fixedColumns = 
                            list(leftColumns=2,heightMatch='none')
                            )
            )
        }
    })
  })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>