0

我正在我闪亮的应用程序中渲染一个表格。表是用 DT 库生成的。这是代码:

output$table <- DT::renderDataTable(DT::datatable({# Displaying table in section tab for principal and director
    if (user_logged$Designation=='director'|user_logged$Designation=='principal'){
    data <- teacher_info[teacher_info$Section == input$sections,]
    data <- data%>%
      select(-c(Section))
    }

这是输出: Table 正如您所见,由于背景颜色,列标题和其他标题变得模糊。我想更改这些文本的颜色,如果可能的话,我还想更改表格的背景颜色。

4

1 回答 1

0

我认为您的问题与此处的问题类似:如何更改闪亮的应用程序 dataTableOutput 字体颜色和辅助表格元素颜色?

你可以加

tags$style(HTML(
".dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing, .dataTables_wrapper .dataTables_paginate {
                    color: #ffffff;
                    }"))

作为 ui 的内联 CSS,该链接还显示了如何更改页码(如果相关)

于 2021-06-29T09:19:57.457 回答