【发布时间】:2017-11-24 06:50:45
【问题描述】:
我有一个很宽很长的闪亮的 DT。默认情况下,我想在表格顶部显示水平滚动条。有没有办法做到这一点?我当前的 DT 定义如下所示:
DT::datatable(dt, rownames = FALSE,
filter = fbox,
style = "bootstrap",
options = list(
dom = dom,
scrollX = TRUE,
columnDefs = list(list(orderSequence = c('desc', 'asc'), targets = "_all")),
processing = FALSE,
pageLength = 500,
lengthMenu = list(c(500, 1000, 5000), c("500","1000","5000"))
),
callback = DT::JS("$(window).unload(function() { table.state.clear(); })")
) %>% DT::formatStyle(., cn_cat, color = "black", backgroundColor = "#dee6ea",fontWeight = "bold")
提前致谢。
【问题讨论】: