gpt4 book ai didi

css - Shinydashboard 选项卡高度

转载 作者:行者123 更新时间:2023-11-28 09:46:24 24 4
gpt4 key购买 nike

我正在尝试创建一个跨越整个 mainPaneltabBox。我能够获得横跨整个屏幕的宽度,但我无法获得相同的高度。我不希望使用以像素(或其他一些单位)为单位的绝对值,因为我希望该应用程序可以跨不同的屏幕使用。

我玩了这个例子和一个 example修改后的tabBox如下

fluidRow(
tabBox(
title = "First tabBox",
# The id lets us use input$tabset1 on the server to find the current tab
id = "tabset1", height = "450px",
tabPanel("Tab1", "First tab content"),
tabPanel("Tab2", "Tab content 2"),
width = 12
),
height = '20%',
width = 12
)

最佳答案

您可以使用定义为 viewport height 的 1% 的 vh css 单元然后基本上按照this answer中的例子在 css 中设置相对高度的位置:

  fluidRow(
tabBox(
tags$head(
tags$style(HTML(" #tabBox { height:90vh !important; } "))
),
id="tabBox",
title = "tabBox",
width = 12
)

当然,您也可以将它放在外部 css 文件中,尤其是当您要执行多个 css 技巧时。由于标题,100% 略微超出底部边缘。大约 90% 似乎工作正常。

关于css - Shinydashboard 选项卡高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31872980/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com