我想删除闪亮DT中n个n个字段的显示。请参阅下面的图片我要删除的内容。
任何见解都非常感谢。
您可以使用dom
选项来确定显示数据表的哪些元素。在数据调用表中,将命名的选项列表传递给options
参数。 dom
接受一个字符串,其中每个元素对应一个DOM元素。
# only display the table, and nothing else
datatable(head(iris), options = list(dom = 't'))
# the filtering box and the table
datatable(head(iris), options = list(dom = 'ft'))
在您的情况下,i
是表信息摘要:这是您想要忽略的那个。您还可以使用此方法删除搜索框或分页控件等其他元素。
有关如何在R:https://rstudio.github.io/DT/options.html中执行此操作,请参见本页的第4.2节
Datatables手册中的这个页面讨论了DOM选项:https://datatables.net/reference/option/dom
您可以使用info直接传递options
选项
library(shiny)
library(DT)
ui <- fluidPage(
dataTableOutput('myTable')
)
server <- function(input, output, session) {
output$myTable <- renderDataTable(mtcars,
options = list(pageLength = 15, info = FALSE)
)
}
shinyApp(ui, server)