Shiny - FluidRow - Creating independent "columns" within a tabPanel in a shiny application that will not move together

Hello,

I am attempting to create a form within my shiny application which needs to present a dynamic number of numeric Input boxes based on the value that was given in a separate field. I have successfully implemented the code to create the appropriate number of numeric input boxes based on the values, and am now stuck on a purely visual issue. The Three different boxes, that I have offset with the colum(offset) argument, seem to all move together (defeating the point of my offset). Does anyone have any idea how I might go about altering the code to have them all start at the top of the tab, and move individually?

Here is the UI and Server code respectively, and an image demonstrating what i am talking about.

UI Code:

tabPanel("Summary",
                   uiOutput("input_panel"),
                   uiOutput("input_panel2"), 
                   uiOutput("input_panel3"))

Server Code:

 #server function 005 - render the summary page based on the inputs for std_concentration variable
  output$input_panel <- renderUI({
    
    lapply(1:input$std_concentration,function(iter1){
      fluidRow(column(2,numericInput(paste0("std_conc",iter1),paste0("Concentration ",iter1),value = 1)))
    })
  })
  #server function 006 - render the summary page based on the inputs for trt_groups variable
  output$input_panel2 <- renderUI({
    
    lapply(1:input$trt_groups,function(iter1){
      fluidRow(column(2, offset = 2, numericInput(paste0("trt_grp",iter1),paste0("Group ",iter1),value = 1)))
    })
  })
  #server action 007 - render the summary page based on the inputs for the trt_treatment variable
  output$input_panel3 <- renderUI({
    
    lapply(1:input$trt_groups,function(iter1){
      fluidRow(column(2, offset = 4, numericInput(paste0("trt_trt",iter1),paste0("Treatment ",iter1),value = 1)))
    })
  })

Image:

Thank you in advanced for the help. And if I have placed this question in the incorrect area or ignored a policy I would be happy to make the appropriate adjustments.

Best,

Chris

Hi @jonesstc. If I didn't get wrong, you want all inputs are at the same level. You may change the code as:
UI Code:

    tabPanel("Summary",
             fluidRow(column(2,
                             uiOutput("input_panel")),
                      column(2,
                             uiOutput("input_panel2")),
                      column(2,
                             uiOutput("input_panel3"))))

Server Code:

 #server function 005 - render the summary page based on the inputs for std_concentration variable
  output$input_panel <- renderUI({
    
    lapply(1:input$std_concentration,function(iter1){
      numericInput(paste0("std_conc",iter1),paste0("Concentration ",iter1),value = 1)
    })
  })
  #server function 006 - render the summary page based on the inputs for trt_groups variable
  output$input_panel2 <- renderUI({
    
    lapply(1:input$trt_groups,function(iter1){
      numericInput(paste0("trt_grp",iter1),paste0("Group ",iter1),value = 1)
    })
  })
  #server action 007 - render the summary page based on the inputs for the trt_treatment variable
  output$input_panel3 <- renderUI({
    
    lapply(1:input$trt_groups,function(iter1){
      numericInput(paste0("trt_trt",iter1),paste0("Treatment ",iter1),value = 1)
    })
  })

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.