【问题标题】:Embedding pictures in shinydashboard在闪亮的仪表板中嵌入图片
【发布时间】:2020-04-30 11:53:56
【问题描述】:

问题:我想在页眉的右上角添加第二张图片。目前,我可以在左上角放置一个,但不能在右上角。

有什么建议吗?

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
                  header = dashboardHeader( titleWidth = NULL,
                                            title = tags$b("Testapp",
                                                           tags$a(href = 'https://www.google.com/', 
                                                                  tags$img(src = 'mick.png', height = 50, width = 50, align = "left"))
                                            ),

                                              ## QUESTION: how can I add the picture to the top right corner
                                             tags$head(tags$img(src = 'mick.png', height = 50, width = 50, align = "right"))



  ),
  dashboardSidebar(),
  dashboardBody()
)

server <- function(input, output) { }

shinyApp(ui, server)

【问题讨论】:

    标签: r shiny shinydashboard


    【解决方案1】:

    Shinydashboard 需要一个 li 元素,其类为 dropdown。如果我们给它(将tags$head(...)替换为以下内容):

    tags$li(tags$img(src = 'mick.png', height = 50, width = 50, align = "right"), class = "dropdown")
    

    它有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-22
      • 2019-07-01
      • 1970-01-01
      • 2019-02-12
      • 2019-06-20
      • 2016-05-02
      • 1970-01-01
      • 2017-08-17
      相关资源
      最近更新 更多