title: How to change the cell color of a cell of an R Shiny data table dependent on it's value?
body: <p>I am attempting to change the cell color of cells of an R Shiny data table dependent on their value. As an example, I've created the following app:</p>
  
  <pre><code># ui.R
  
  fluidPage(
    # Outputting data table.
    DT::dataTableOutput("table")
  )
  
  # server.R
  
  library(DT)
  
  data(iris)
  
  function(input, output) {
  
    # Rendering data table.
    output$table &lt;- DT::renderDataTable({
      head(iris)
    },
    options = list(dom = "t",
                   ordering = FALSE))
  
  }
  </code></pre>
  
  <p>And the following is the generated HTML skeleton and resultant page from the above code:</p>
  
  <p><a href="https://i.stack.imgur.com/m36wT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/m36wT.png" alt="HTML code generated by R Shiny to display the first 6 lines of the iris dataset as a data table"></a></p>
  
  <p><a href="https://i.stack.imgur.com/AvWN9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AvWN9.png" alt="first 6 lines of the iris dataset displayed as a data table in R Shiny"></a></p>
  
  <p>As an example, lets say that I want all cells containing integers to be colored red. Selectively, I'd like to color only the cells at row 2 column 2 and row 5 column 1 where the values are 3 and 5 respectively. Is this possible in R Shiny?</p>
  
  <p>My current idea for a work around is to set the class of individual cells server-side and color them later with CSS. However, I can't find a way to do this.</p>