I'm rendering datatable in my shiny application where the column names of the tables are particularly quite large. I want to wrap it in order to show maximum info to the user which otherwise is just showing 1 or 2 columns max in the entire window. My 2 questions are
- Some sources mentioned that rendered datatables in shiny, wrap the text by default. is it true? if yes then what am I doing wrong?
- How do I go about wrapping the colnames in my datatables?
Following is the code I'm using
DT::renderDataTable({
req(data())
ans <- data()
ans[,2:ncol(ans)] <- round(ans[,2:ncol(ans)], table_output_rounding_global)
colnames(ans)[1] <- "Statistic"
colnames(ans)[2] <- "CoV "
ans},
options = list(pageLength=10 ),
server = FALSE
)