Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R改变数据框轮廓的颜色_R_Shiny - Fatal编程技术网

R改变数据框轮廓的颜色

R改变数据框轮廓的颜色,r,shiny,R,Shiny,我的服务器文件中有一个数据帧,如下所示 output$table<-renderTable({ P.Value<- c(lev.p,bart.p,turn.p,shap.p,jar.p,linm.p) Test.Statistic<-c(lev.s,bart.s,turn.s,shap.s,jar.s,linm.s) df<-data.frame(P.Value,Test.Statistic) rowna

我的服务器文件中有一个数据帧,如下所示

output$table<-renderTable({
        P.Value<- c(lev.p,bart.p,turn.p,shap.p,jar.p,linm.p) 
        Test.Statistic<-c(lev.s,bart.s,turn.s,shap.s,jar.s,linm.s) 
        df<-data.frame(P.Value,Test.Statistic)
        rownames(df, do.NULL = TRUE, prefix = "row")
        rownames(df) <- c("Levene Test","Bartlett Test","Turning Point Test","Shapiro-Wilk Test","Jarque Bera Test","Linear Model Constant Drift Test")

        df
  })
这将生成如下表

然而,我想把桌子的灰色轮廓变成另一种颜色,比如黑色。我该怎么做呢


谢谢

下面是一个如何在表格中设置边框样式的示例。有关详细信息,请转到。同时,也要熟悉和研究这些问题。在这里,我使用标签来设置边框的样式(标题为蓝色,其余为黑色)。你可以在谷歌上搜索CSS颜色,也可以找到例子

编辑:您还可以使用像素控制边框:
边框宽度:5px查找更多信息

rm(list = ls())
library(shiny)

test_table <- cbind(rep(as.character(Sys.time()),10),rep('a',10),rep('b',10),rep('b',10),rep('c',10),rep('c',10),rep('d',10),rep('d',10),rep('e',10),rep('e',10))
colnames(test_table) <- c("Time","Test","T3","T4","T5","T6","T7","T8","T9","T10")

ui =navbarPage(inverse=TRUE,title = "Coloring Table Borders",
               tabPanel("Logs",icon = icon("bell"),mainPanel(htmlOutput("logs"))),
               tags$style(type="text/css", "#logs th, td {border: medium solid #00F;text-align:center}"),
               tags$style(type="text/css", "#logs td {border: medium solid #000000;text-align:center}"))

server <- (function(input, output, session) {
  my_test_table <- reactive({as.data.frame(test_table)})
  output$logs <- renderTable({my_test_table()},include.rownames=FALSE)
})

runApp(list(ui = ui, server = server))
rm(list=ls())
图书馆(闪亮)

test_table闪亮应用程序中元素的样式可以通过CSS进行控制。有关更多信息,请查看。谢谢!快速问题对于标签$style(type=“text/css”,“#logs td{border:medium solid#000000;text align:center}”)部分,如何使轮廓不那么厚?您可以用像素控制它,例如边框宽度:5px;请查看此处以了解更多信息
rm(list = ls())
library(shiny)

test_table <- cbind(rep(as.character(Sys.time()),10),rep('a',10),rep('b',10),rep('b',10),rep('c',10),rep('c',10),rep('d',10),rep('d',10),rep('e',10),rep('e',10))
colnames(test_table) <- c("Time","Test","T3","T4","T5","T6","T7","T8","T9","T10")

ui =navbarPage(inverse=TRUE,title = "Coloring Table Borders",
               tabPanel("Logs",icon = icon("bell"),mainPanel(htmlOutput("logs"))),
               tags$style(type="text/css", "#logs th, td {border: medium solid #00F;text-align:center}"),
               tags$style(type="text/css", "#logs td {border: medium solid #000000;text-align:center}"))

server <- (function(input, output, session) {
  my_test_table <- reactive({as.data.frame(test_table)})
  output$logs <- renderTable({my_test_table()},include.rownames=FALSE)
})

runApp(list(ui = ui, server = server))