【发布时间】:2018-10-22 11:16:03
【问题描述】:
我们如何在闪亮的应用程序中更改 DT 表的颜色主题?默认情况下,交替行使用深色和浅灰色。我正在使用formatStyle(target = 'row', backgroundColor = c('yellow', 'red')。但它不起作用,因为它仅适用于列
library(shinydashboard)
header <- dashboardHeader(title = 'title')
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem('dashboard', tabName = 'dashboard', icon = icon('dashboard'))
)
)
body <- dashboardBody(
box(
title = 'box', width = NULL, status = 'primary',
DT::dataTableOutput('table2')
)
)
ui<-dashboardPage(header, sidebar, body)
server = function(input, output) {
output$table2 = DT::renderDataTable(
iris, options = list(lengthChange = FALSE)
)
}
shinyApp(ui, server)
【问题讨论】: