Q: Issues with controlling width of columns in a rendered datatable Shiny To render a datatable in a shiny app I use the following code
    ui <- fluidPage(

  box(width = 10,  # this is to control table width
      DT::DTOutput(('table'))
  )
)

server <- function(input, output) {
  
  options(shiny.maxRequestSize=10000*1024^2) 

    
    output$table <- DT::renderDataTable(
      datatable(
        dataset ,
        options = list(dom = 'fltipr',
                       pageLength = 1000,
                       #lengthMenu = list(c(250, 500), c('250', '500')),
                       searchHighlight = TRUE,
                       autoWidth = TRUE,
                       columnDefs = list(list(width = '300px', targets = c(7,10)), # this is to control width of two columns
                                         list(visible = FALSE, targets = c(2,4,6, 8,11,13,15,16,17:23)))
                       
        ), filter = 'top', 
        
        selection = 'none',
        editable = 'cell')
    )
 }

With that that setup I am trying to control the width of two of the visible columns. When I run the app, it renders fine, just as I wanted it to be rendered.
But when I try to sort the rendered datatable by one of the columns, the controls for column width  (and even the whole table width) stop working. The initially controlled column that contains long sections of text now becomes so wide it does not fit on the page, and I have to scroll sideways.
In essence I would like all table to fit on page, with width of two textual columns controlled strictly not matter how I sort the rendered datatable.
Sincerely,
Maria
