这是我的方法:
library(shiny)
library(DT)
ui <- fluidPage(
tags$style("#mydatatable thead > tr:nth-child(2) {display:none;}"),mainPanel(
dataTableOutput("mydatatable")
)
)
server <- function(input,output) {
output$mydatatable <- DT::renderDataTable(
datatable(iris,filter = 'top',options = list(
pageLength = 5,autoWidth = TRUE)
)
)
}
shinyApp(ui = ui,server = server)