首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在闪亮应用程序的侧边栏中设置同一行小部件之间的距离

如何在闪亮应用程序的侧边栏中设置同一行小部件之间的距离
EN

Stack Overflow用户
提问于 2020-06-08 02:13:55
回答 1查看 106关注 0票数 0

下面有一个闪亮的仪表板,我想在操作按钮之间设置特定的距离。边栏的宽度越大,它们之间的空间就越大,但我想用更标准的方式设置它。

代码语言:javascript
复制
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
    header = dashboardHeader(title = "My dashboard"),
    sidebar = dashboardSidebar(width=1000,
        fluidRow(

            column(2,
                   div(style="display:inline-block",actionButton('ExampleIRD', 'Interest Rates Derivatives'),width=6)
            )       
            ,

            column(2,
                   div(style="display:inline-block",actionButton('ExampleCredit', 'Credit Derivatives'),width=6)
            ),

            column(2,
                   div(style="display:inline-block",actionButton('ExampleComm', 'Commodity Forwards'),width=6)
            ),

            column(2,
                   div(style="display:inline-block",actionButton('ExampleIRDCredit', 'IR + Credit Derivatives'),width=6)
            ),

            column(2,
                   div(style="display:inline-block",actionButton('ExampleIRDCommMargined', 'IR + Commodity Derivatives Margined'),width=6)
            )

        )
    ),
    body = dashboardBody(

    )
)

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




}

shinyApp(ui, server)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-08 04:05:22

在UI中尝试padding,如下面的代码所示:

代码语言:javascript
复制
ui <- dashboardPage(
  header = dashboardHeader(title = "My dashboard"),
  sidebar = dashboardSidebar(width=1000,
                             fluidRow(

                               column(2,
                                      div(style="display:inline-block; padding: 5px 5px 5px 1px;",actionButton('ExampleIRD', 'Interest Rates Derivatives'))
                               ),

                               column(2,
                                      div(style="display:inline-block; padding: 5px 1px 5px 25px;",actionButton('ExampleCredit', 'Credit Derivatives'))
                               ),

                               column(2,
                                      div(style="display:inline-block; padding: 5px 3px 5px 1px;",actionButton('ExampleComm', 'Commodity Forwards'))
                               ),

                               column(2,
                                      div(style="display:inline-block; padding: 5px 3px 5px 1px;",actionButton('ExampleIRDCredit', 'IR + Credit Derivatives'))
                               ),

                               column(3,
                                      div(style="display:inline-block; padding: 5px 3px 5px 1px;",actionButton('ExampleIRDCommMargined', 'IR + Commodity Derivatives Margined'))
                               )

                             )
  ),

您将得到以下输出:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62254003

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档