繁体   English   中英

底部对齐R闪亮的按钮

[英]bottom align a button in R shiny

我无法找到一种方法来将downloadButtonselectizeInput对齐,即

在此输入图像描述

library(shiny)

runApp(list(
  ui = shinyUI(fluidPage(
    fluidRow(align="bottom",
      column(12, align="bottom",
             h4("Download Options:"),
             fluidRow(align="bottom", 
                      column(6, selectizeInput("plot_dl", "File Type", width="100%",  
                                               choices = list("PDF"="pdf","PNG"="png"))),
                      column(3, downloadButton('plot1_dl', 'Left Plot')),
                      column(3, downloadButton('plot2_dl', 'Right Plot'))
             )
      )
    ),
    tags$style(type='text/css', "#plot1_dl { width:100%; vertical-align:bottom}"),
    tags$style(type='text/css', "#plot2_dl { width:100%;}")
  )),
  server = function(input, output) {
  }
))

在任何地方和任何地方放置align="bottom"不会抛出错误消息,但也没有所需的效果。 尝试使用按钮的样式标签,但我的深度。

找到了一个带有margin-top: 25px的特别修复margin-top: 25px样式标签中的margin-top: 25px ...

在此输入图像描述

library(shiny)

runApp(list(
  ui = shinyUI(fluidPage(
     h4("Download Options:"),
     fluidRow(
       column(6, selectizeInput("plot_dl", "File Type", width="100%",
                                choices = list("PDF"="pdf","PNG"="png"))),
       column(3, downloadButton('plot1_dl', 'Left Plot')),
       column(3, downloadButton('plot2_dl', 'Right Plot'))
     ),
     tags$style(type='text/css', "#plot1_dl { width:100%; margin-top: 25px;}"),
     tags$style(type='text/css', "#plot2_dl { width:100%; margin-top: 25px;}")
  )),
  server = function(input, output) {
  }
))

其他方法是在列函数中传递style参数。


runApp(list(
        ui = shinyUI(fluidPage(
                h4("Download Options:"),
                fluidRow(
                        column(6, selectizeInput("plot_dl", "File Type", width="100%",
                                                 choices = list("PDF"="pdf","PNG"="png"))),
                        column(3, style = "margin-top: 25px;", downloadButton('plot1_dl', 'Left Plot')),
                        column(3, style = "margin-top: 25px;", downloadButton('plot2_dl', 'Right Plot'))
                )
        )),
        server = function(input, output) {
        }
))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM