setting column width
setting column width
I'd like to set the column width to adjust automatically for the column contents. I tried this code but it didn't work.
output$book_table <- DT::renderDT(RVTables$book %>% filter(deal==1),
selection = 'single',
editable = TRUE,
rownames = FALSE,
options=list(
#drawCallback = I("function( settings ) {document.getElementById('ex1').style.width = '600px';}"),
autoWidth=TRUE,
ordering=FALSE,
pageLength=12,
scrollX = TRUE,
scrollY = TRUE,
bLengthChange= FALSE,
searching=FALSE
)
)
Answers
Hi @white_rabbit ,
We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi Colin, i'm using datatable in a R shiny app so its not so easy to share a working version. I'll take a look at the references and see what I can do.
thanks
hugh
Here's the R code I'm using:
output$book_table <- DT::renderDT(RVTables$book %>%
filter(deal==as.numeric(input$deal_choice)),
selection = list(mode="single",selected=row_edited),
editable = TRUE,
rownames = FALSE,
options=list(
#drawCallback = I("function( settings ) {document.getElementById('ex1').style.width = '600px';}"),
autoWidth=TRUE,
ordering=FALSE,
pageLength=12,
scrollX = TRUE,
scrollY = TRUE,
bLengthChange= FALSE,
searching=FALSE
)
)