gpt4 book ai didi

shiny - 如何改变 Shiny 导航栏中的填充

转载 作者:行者123 更新时间:2023-12-04 04:09:10 26 4
gpt4 key购买 nike

我试图消除此表格与浏览器窗口左侧之间的空间,但当我这样做时,它弄乱了导航栏链接和标题的间距。

如何在不改变 navbar/ui/li 元素的填充/边距的情况下删除 excelR 表上的填充/边距?

library(shiny)
library(excelR)

shinyApp(
ui = navbarPage("title", selected = "main",
position = "fixed-top",
tags$style(type="text/css", "body {padding-top: 70px;}"),
tags$head(
tags$style(
"body {overflow-y: hidden;}"
)
),
tags$head(
tags$style(type = "text/css", ".container-fluid {padding-left:0px;
padding-right:0px; margin-right:0px; margin-left:0px;}")
),

tabPanel("main", id = "main",
fluidPage(
excelOutput("table", width = "100%", height = "1000px")
#htmlOutput("table", width = "100%", height = "500px")
)
)
),
server = function(input, output, session) {
output$table <-renderExcel(
excelTable(
data = iris,
autoColTypes = FALSE,
autoFill = TRUE,
fullscreen = FALSE,
lazyLoading = TRUE,
search = TRUE,
tableHeight = "800px",
pagination <- NULL
)
)
}
)

最佳答案

您可以简单地将这个额外的 css 添加到您的代码中:

     tags$style(type = "text/css", ".navbar{padding-left:15px;
padding-right:15px ; margin-right:auto; margin-left:auto;}")
),

希望这对您有所帮助!

关于shiny - 如何改变 Shiny 导航栏中的填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62052968/

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