I'm currently building a dashboard with flexdashboard and want to present one tab on my dashboard as showing the raw data organised into a data table using the datatable function in R.
When the dashboard generates, the rows have a huge height due to some large character entries in that string. E.g. certain ids in the format "xxxxxx-xxxx-xxxx-xxxxxx". It doesn't present them like this however, they are normally in the row presented as:
xxxxxx-
xxxx-
xxxx-
xxxxxx
creating the huge height.
A similar thing happens with date formats in the YYYY-MM-DD HH:MM:SS format however the issue doesn't occur when using very long character strings without any "-" in it. e.g. the column width will adjust properly for "xxxxxxxxxxxxxxxxxxxxxxx"
I had a look through stackoverflow and couldn't find anything similar, questions would mostly be around autoWidth not being set to true. And as mentioned column width adjusts automatically for certain types of character strings just not ones with "-" in it.
datatable(data1,
rownames=T,
filter ="top",
options=list(pageLength=100,
autoWidth=T,
scrollX=T))
You can disable the wrapping by using the class nowrap
DT::datatable(
class = "display nowrap",
extensions = c('Buttons','Scroller'),
...…