我发现如何在Shiny中更改用户界面的背景颜色.我发现的退出是它也为我正在展示的桌子的背景着色tableOutput.这里我展示一个虚拟的例子.
ui.R
shinyUI(pageWithSidebar(
headerPanel("Dummy"),
sidebarPanel(标签$ hr()),mainPanel中(
Run Code Online (Sandbox Code Playgroud)# This is what I use to change the background color list(tags$head(tags$style("body {background-color: #ADD8E6; }"))), tableOutput("dummy") ) ))
server.R
shinyServer(函数(输入,输出){output $ dummy < - renderTable({data.frame(A = 1:4,B = 2:5,C = rep("aaa",4))})})
我得到的就是这个

我想得到什么(我使用GIMP重新创建)是

谢谢大家的帮助!
Sté*_*ent 15
已经在闪亮的谷歌群体上给出了一个解决方案:
runApp(
list(ui = bootstrapPage(pageWithSidebar(
headerPanel("Rummy"),
sidebarPanel( tags$hr() ),
mainPanel(
tableOutput("dummy"),
# change style:
tags$head(tags$style("#dummy table {background-color: red; }", media="screen", type="text/css"))
)
)
)
,
server = function(input, output) {
output$dummy <- renderTable({ data.frame(A=1:4,B=2:5,C=rep("aaa",4)) })
}
)
)
Run Code Online (Sandbox Code Playgroud)
我还邀请您阅读有关闪亮的Google群组的讨论,该群组展示了如何使用pander包生成html表格并将其插入闪亮的应用程序中.这样可以更灵活地控制样式.