将 shiny_iconLink 和 checkboxInput 放在 Shiny 中的同一行

Putting shiny_iconLink and checkboxInput on the same line in Shiny

我正在尝试将带有模态的 shiny_iconlink() 与复选框输入放在同一行。我一直在摆弄 div 类 和 ID,但似乎没有任何效果。

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

正如@SBista 所建议的,您使用 fluidRowcolumnThis article about Shiny application layout is helpful, especially the section on the 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)