title: how to color specific data table cells in r shiny data table
body: <p>I have a data table created from a dataframe like this :</p>
  
  <pre><code>output$main_temp &lt;- renderDataTable(df[,-1:-1], width = "auto")
  </code></pre>
  
  <p>I would like to color with and without values. Cells with values with green and without values to red.</p>
  
  <p>I tried :</p>
  
  <pre><code>output$main_temp &lt;- renderDataTable({
  datatable(df[,-1:-1], options = list(
      columnDefs = list(list(targets = 6, visible = FALSE))
  )) %&gt;% formatStyle(
    names(df[,-1:-1]),
    backgroundColor = styleEqual(c(0, 1), c('gray', 'yellow'))
  )
  })
  </code></pre>
  
  <p>Sample data :</p>
  
  <p><a href="https://i.stack.imgur.com/xoutj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xoutj.png" alt="Sample data"></a></p>
  
  <p>Required output:</p>
  
  <p><a href="https://i.stack.imgur.com/3LxE7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3LxE7.png" alt="output"></a></p>