您可以使用该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'))
Run Code Online (Sandbox Code Playgroud)
在您的情况下,i是表信息摘要:这是您想要忽略的那个.您还可以使用此方法删除搜索框或分页控件等其他元素.
有关如何在R中执行此操作,请参阅本页的第4.2节:https://rstudio.github.io/DT/options.html
Datatables手册中的这个页面讨论了DOM选项:https://datatables.net/reference/option/dom
您可以直接使用传递信息选项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)
Run Code Online (Sandbox Code Playgroud)