Блестящий использовать более 12 столбцов в одной строке - PullRequest
0 голосов
/ 01 мая 2019

Я новичок в Shiny, так что, вероятно, у меня простой вопрос, но никто не может найти что-то подобное здесь, на stackoverflow.com. Мне нужно было бы создать приложение с более чем 12 столбцами. Итак, мой вопрос: как я могу разместить более 12 элементов textInput в одной строке и сделать их ширину немного более узкой? Это мой пример кода.

library(shiny) 
u <- fluidPage(   
  titlePanel("Simple Selectable Reactive Function"),   
  sidebarLayout(
    sidebarPanel(),
    mainPanel(
      h2("Results"),
      fluidRow(column(1,
                      textInput("input_ID", label = "text 1",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 2",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 3",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 4",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 5",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 6",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 7",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 8",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 9",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 10",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 11",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text Inp 12",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text Inp 13",
                                value = "123"))

      )
    )
  )
)

s <- function(input,output){} 
shinyApp(ui=u,server=s)

спасибо за помощь.

1 Ответ

1 голос
/ 01 мая 2019

Вы можете снова использовать fluidRow в column. Последний column снова делится на две колонки.

library(shiny) 
u <- fluidPage(   
  titlePanel("Simple Selectable Reactive Function"),   
  sidebarLayout(
    sidebarPanel(),
    mainPanel(
      h2("Results"),
      fluidRow(
              column(1,
                      textInput("input_ID", label = "text 1",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 2",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 3",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 4",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 5",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 6",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 7",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 8",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 9",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 10",
                                value = "123")),
               column(1,
                      textInput("input_ID", label = "text 11",
                                value = "123")),

               column(1, fluidRow(column(6,
                                         textInput("input_ID", label = "text 12",
                                                   value = "123")),
                                  column(6,
                                         textInput("input_ID", label = "text 13",
                                                   value = "123"))))

      )
    )
  )
)

s <- function(input,output){} 
shinyApp(ui=u,server=s)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...