我有一个闪亮的数据表,如下所示:
但是,我希望它在所有单元格周围都有完整的边框,使其看起来更像excel表格。我知道在闪亮的表中,它就像调用bordered = T
一样简单,但这对于Shiny中的数据表不起作用。
这是我的用户界面代码:
fluidRow(
DT::dataTableOutput("stats_table", width = "95%")
)
这是我的服务器代码:
output$stats_table <- DT::renderDataTable(DT::datatable({
# Do not show a plot when the page first loads
# Wait until the user clicks "Plot" button
if (input$plot_graph_button == 0)
return()
data <- summary_table
#### Do some filtering here ####
data
}))
提前感谢您的帮助,我觉得这应该是一个非常简单的解决方案,但是,我没有找到任何有关它的好信息。我确实认识到这纯粹是装饰性的,不会影响桌子的功能。
答案 0 :(得分:1)
您可以使用cell-border stripe
课程。查看here了解更多选项
output$stats_table <- DT::renderDataTable({
# Do not show a plot when the page first loads
# Wait until the user clicks "Plot" button
# if (input$plot_graph_button == 0)
# return()
data <- datatable(head(iris), class = 'cell-border stripe')
#### Do some filtering here ####
data
})