如何设置 "DT::renderDataTable" 我可以复印或打印所有 table 而不是一页?

How to set "DT::renderDataTable" that I can copy or print all of the table not noly one page?

这是我的代码,我想复制或打印全部,但它只打印当前页,谢谢!

library(shiny)
library(DT)
ui <- fluidPage(
  DT::dataTableOutput("tt")
)

server <- function(input, output, session) {
  iris2 = head(iris, 20)
  output$tt <- DT::renderDataTable(
    iris2,
    extensions = 'Buttons', options = list(
      dom = 'Bfrtip',
      buttons = c('copy', 'print')
    )
  )
  
}

shinyApp(ui, server)

最简单的方法是使用选项 server = FALSE

  output$tt <- renderDT({
    datatable(
      iris2,
      extensions = 'Buttons', 
      options = list(
        dom = 'Bfrtip',
        buttons = c('copy', 'print')
      )
    )
  }, server = FALSE)