Changing Font Size in R Datatables (Dt)

RStudio Shiny renderDataTable font size

You can put dataTableOutput("tableName") inside of div()and change the font using the style parameter. style takes CSS arguments.

For example, if have this...

dataTableOutput("tableName")

you can change it like this...

div(dataTableOutput("tableName"), style = "font-size:80%")

to make the font size 20% smaller.

Shrink DT::dataTableOutput Size

Try adding width: 75% to your style parameter of the div:

div(DT::dataTableOutput("table"), style = "font-size: 75%; width: 75%")

How to change the font color of a DT table based on another matrix in R

You could just use styleInterval like this:

formatStyle(columns = 1:10, valueColumns = 11:20, color = styleInterval(c(-1e-10, 1e-10), c('red', 'blue', 'green')))

Here we use two breaks at -1e-10 and +1e-10. Everything in between, so basically the zeros, will be blue.



Related Topics



Leave a reply



Submit