将shiny_iconLink和checkboxInput放在Shiny的同一行

时间:2018-02-14 23:48:46

标签: checkbox shiny icons inline

我正在尝试将一个带有模态的shiny_iconlink()放在与checkboxInput相同的行上。我一直在搞乱div类和id,但似乎没有任何工作。

fluidRow(
  column(width = 4,
         span(id="icon", shiny_iconlink()),
         checkboxInput("checkbox", "get me inline"),
         bsModal("modal", "title", "icon", "content")
        )
)

1 个答案:

答案 0 :(得分:0)

正如@SBista建议的那样,您使用fluidRowcolumn。关于Shiny应用程序布局的This article很有帮助,尤其是fluid grid system上的部分。

试试这个:

library(shiny)
library(bsplus)    
library(shinyBS)

ui <- fluidPage(
    fluidRow(
        column(width = 1,
               span(id="icon", shiny_iconlink())),
        column(width = 2,
               checkboxInput("checkbox", "get me inline"),
               bsModal("modal", "title", "icon", "content")
        )
    )
)

server <- function(input, output, session) {

}

shinyApp(ui, server)