Remove “Showing 1 to N of N Entries” Shiny DT

浪尽此生 提交于 2020-07-14 06:23:33

问题


Issue:

I'm looking to remove the showing 1 to n of n entries field in shiny DT. Please see picture below of what I would like to REMOVE.

Any insight is much appreciated.


回答1:


You can use the dom option to determine which elements of the data table are shown. In the call to data table, you pass a named list of options to the options argument. dom accepts a character string where each element corresponds to one DOM element.

# 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'))

In your case, i is the table information summary: that's the one you want to leave out. You can also use this method to remove other elements like the search box or pagination controls.

See section 4.2 on this page for how to do this in R: https://rstudio.github.io/DT/options.html

This page in the Datatables manual discusses the DOM option: https://datatables.net/reference/option/dom




回答2:


You can pass the info option directly using 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)


来源:https://stackoverflow.com/questions/51730816/remove-showing-1-to-n-of-n-entries-shiny-dt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!