autoWidth Rendering Garbled
---
title: "autoWidth garbled"
output: flexdashboard::flex_dashboard
---
```{r}
library(tidyverse)
library(DT)
datatable(mtcars %>% as_tibble() %>% select(1:4),
options = list(autoWidth = TRUE,
columnDefs = list(list(width = '50px',
targets = "_all"))))
```
The code above is my first attempt at autoWidth within DT and flexdashboard. The code looks correct, yet the output is quite garbled (ie the column headings are not aligned with the column bodies). Tested in Chrome. I imagine IE and Safari won't fare much better. Version Info: [1] DT_0.16 flexdashboard_0.5.2
Does that {DT} code work for you outside of {flexdashboard} (if so, can you also please include a screenshot of the "expected" result?)
I can reproduce this. The key is that the header column should be centered over the table but it moves whenever the window is resized. It appears as expected in an html_document() so there's a chance it's the result of an interaction with flexdashboard's CSS.

