相关疑难解决方法(0)

在Shiny主面板中右对齐元素

我有一个带左侧边栏的Shiny应用程序,我想将mainPanel中的图形对齐到右侧.我已经尝试添加style = "align:right"到mainPanel中的每个元素,以及包装我能想到的所有内容div(..., style = "align:right").这些都没有效果.

您可以在RStudio库中使用此示例.我想将"表"选项卡中的输出对齐到右侧.这是ui.R的相关部分:

mainPanel(
  tabsetPanel(type = "tabs", 
    tabPanel("Plot", plotOutput("plot")), 
    tabPanel("Summary", verbatimTextOutput("summary")), 
    tabPanel("Table", tableOutput("table"))
  )
)
Run Code Online (Sandbox Code Playgroud)

r alignment shiny

7
推荐指数
1
解决办法
2万
查看次数

如何在 R Shiny 应用程序中对齐 downloadButton 和 ActionButton?

我有一个 Shiny 应用程序,侧边栏上有两个按钮,但我无法对齐它们。我尝试了此处给出的解决方案(Shiny R 对齐按钮),但它对我不起作用。

这是它们的样子

这是一个可重现的代码:


library(shiny)
library(DBI)
library(shinydashboard)
library(DT)
library(shinyjs)


ui <- dashboardPage(
#Header 
  dashboardHeader(title = "Labware dashboard"),
#Sidebar with download button  
  dashboardSidebar(
    width = 130,
    downloadButton('downloadData',
                   'Download',
                   style = "color: #fff; background-color: #27ae60; border-color: #fff"),
#Create a button in the sidebar to stop app
    useShinyjs(),
    extendShinyjs(text = jscode, functions = ("closeWindow")),
    actionButton("close", "Close window", 
                icon("close"),
               style = "color: #fff; background-color: red; border-color: #fff")
  ),
  
  dashboardBody()
  
  )


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

  #close the …
Run Code Online (Sandbox Code Playgroud)

r button shiny

2
推荐指数
1
解决办法
473
查看次数

标签 统计

r ×2

shiny ×2

alignment ×1

button ×1