I'm currently learning to use R shiny dashboard. I'm using fluidrow(column(...)) to do my page layout. I'm currently facing a problem: I can't put as much elements as I would like in a row. Basically, I would like to put a lot of elements on the same line with an horizontal scrollbar.
example:
library(shiny)
library(shinydashboard)
header <- dashboardHeader(title = "My Dashboard")
sidebar <- dashboardSidebar(
sidebarMenu(
id = "tabs",
menuItem("My Tab", tabName = "my_Tab", icon = icon("th"))
)
)
body <- dashboardBody(
tabItems(
tabItem(tabName = "my_Tab",
fluidRow(
column(width = 2,
numericInput("n1", "N", value = 1, min = 0, max = 10, step = 1)
),
column(width = 2,
numericInput("n2", "N", value = 1, min = 0, max = 10, step = 1)
),
column(width = 2,
numericInput("n3", "N", value = 1, min = 0, max = 10, step = 1)
),
column(width = 2,
numericInput("n4", "N", value = 1, min = 0, max = 10, step = 1)
),
column(width = 2,
numericInput("n5", "N", value = 1, min = 0, max = 10, step = 1)
),
column(width = 2,
numericInput("n6", "N", value = 1, min = 0, max = 10, step = 1)
),
column(width = 2,
numericInput("n7", "N", value = 1, min = 0, max = 10, step = 1)
)
)
)
)
)
ui <- dashboardPage(
header,
sidebar,
body
)
server <- function(input, output, session) {
session$onSessionEnded(function() {
stopApp()
})
}
shinyApp(ui, server)
Here, the last numeric input is not display next to the n6 numeric input. Does anyone knows how to solve my problem ? I did not find any solution on the internet even though I'm pretty sure it is not that hard.
Thank you !