How to make multiple inputs via numericInput or otherwise like shown in the image in R Shiny?
Are you asking how to style your app ? the answer is with CSS.
If you want multiple numericInputs you will have to write code to place multiple numericInputs.
Arrange them in a grid, add text to the grid, you can achieve the image, this can be done in many ways.
Heres a simplistic example based on div's
library(shiny)
ui <- fluidPage(
div(
style = "display:flex;gap:2em;",
div(style="width:6em",
br(),
tags$label("Score")),
numericInput("n1", "Exam 1", 50,width = "6em"),
numericInput("n2", "Exam 2", 50,width = "6em")
),
div(
style = "display:flex;gap:2em;",
div(style="width:6em",
br(),
tags$label("No Q")),
numericInput("n3", "", 50,width = "6em"),
numericInput("n4", "", 50,width = "6em")
)
)
server <- function(input, output, session) {
session$onSessionEnded(function() {
stopApp()
})
}
shinyApp(ui, server)
This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.