R语言 如何在shiny中居中对齐modalDialog中的标题和按钮?

yrdbyhpb  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(62)

我尝试了以下方法,只将操作按钮居中:

modalDialog(
    style = "text-align:center;",
    title = div("Welcome!", style = "text-align: center;"),
    
    shinyWidgets::actionBttn(inputId = ns("start"),
               label = "Start",
               style = "jelly",
               color = "danger")
)

字符串
这是在一个模块中。标题和'Dismiss' modalButton分别左对齐和右对齐。

xmakbtuz

xmakbtuz1#

不确定按钮,但对于标题和文本,您可以使用align = "center"

modalDialog(
    align = "center", # center the dialog text
    title = div("Welcome!", align = "center"), # center the dialog title

    shinyWidgets::actionBttn(inputId = ns("start"),
           label = "Start",
           style = "jelly",
           color = "danger")
)

字符串

相关问题