我只是想在启用ScrollX的情况下向右滚动时保持最左边的列固定,而无法使其正常工作。知道我需要做些什么吗?
library(shiny)
library(DT)
ui <- fluidPage(
fluidRow(mainPanel(DT::dataTableOutput('mtcars'), width = 12))
)
server <- server <- function(input, output, session) {
output$mtcars <- DT::renderDataTable({
mtcars %>%
DT::datatable(
selection = 'none', rownames = '', filter = 'none',
options = list(
paging = TRUE, searching = TRUE, info = FALSE,
sort = TRUE, scrollX = TRUE, fixedColumns = list(leftColumns = 1)
)
)
})
}
shinyApp(ui = ui, server = server)
Run Code Online (Sandbox Code Playgroud)
此处的版本信息:
> packageVersion('DT')
[1] ‘0.4.16’
> packageVersion('shiny')
[1] ‘1.1.0’
> version
_
platform …Run Code Online (Sandbox Code Playgroud)