我建立这个UI一个闪亮的应用程序。这里是nhl-logo.png
ui <- fluidPage(
titlePanel(tagList(
img(src = "nhl-logo.png", height = 60, width = 60),
"PLAY-BY-PLAY"),
windowTitle = "NHL Play-by-Play"),
div(style = "position:absolute;right:2em;",
actionButton('load_inputs', 'Load inputs'),
actionButton('save_inputs', 'Save inputs')
),
hr(),
fluidRow(...)
不幸的是,style
是不是我想要的,因为它把上比标题较低级别的actionButtons(NHL LOGO PLAY-BY-PLAY)
如何改变style
让我actionButtons出现在同一水平的titlePanel
?
您可以在span
其中包括按钮添加标题。一个span
和div
之间的区别是,span
是内联(一个div
是一个块)。
ui <- fluidPage(
titlePanel(tagList(
img(src = "nhl-logo.png", height = 60, width = 60),
span("PLAY-BY-PLAY",
span(actionButton('load_inputs', 'Load inputs'),
actionButton('save_inputs', 'Save inputs'),
style = "position:absolute;right:2em;")
)
),
windowTitle = "NHL Play-by-Play"
),
hr(),
fluidRow()
)
server <- function(input, output, session) {
}
shinyApp(ui, server)