I have a very small table and I'm using DT throughout my project so I want this small table to look constant.
When using the the width argument in DT::datatable() to reduce its width, the table is left justified while centering it would look much nicer.
I've tried using fig.align = 'center' in the chunk options but it hasn't helped.
library(DT)
datatable(cars, width = 300)
How about using <div> if you use HTML report:
<div align="center">
```{r}
library(DT)
datatable(cars, width = 300)
```
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With