R shiny datatable filter box size to narrow to see text R shiny datatable filter box size to narrow to see text r r

R shiny datatable filter box size to narrow to see text


I solved this problem using CSS:

input {    width: 100px !important;}

You can also apply this style to factor filters only:

td[data-type="factor"] input {    width: 100px !important;}

Put my.css file in www subdirectory, and link to it:

shinyApp(    ui = fluidPage(        tags$head(            tags$link(                rel = "stylesheet",                type = "text/css",                href = "my.css")        ),        DT::dataTableOutput(...)    )


A similar question was answered here.

Also, in order to use range sliders to filter rows within ranges, consider converting the "Date List" column to the date format using as.Date().


Yihui's solution here seems to work very well:https://github.com/rstudio/DT/issues/172

datatable(..., options = list(autoWidth = TRUE))