我有一个带左侧边栏的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) 我有一个 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)