title: Change RenderTable Row Color with if-else condition
body: <p>I am writing a RenderTable, and I want to change the color of the row with if condition.</p>
  <pre><code>### I need txt0 to determine which output table should I highlight, and MASE_name[best_model_index] to determine which model to highlight
    output$recommended_model &lt;- renderPrint({
      if (is.null(runbutton_hit2_2())) return()
      if(best_model_index&gt;5)
        txt0&lt;&lt;-paste0(&quot; (Rate - based.)&quot;)
      else
        txt0&lt;&lt;-paste0(&quot; (Number - based.)&quot;)
      paste0(&quot;The most recommended model is &quot;,MASE_name[best_model_index],txt0)
  
    })
  
  ###Table 1
    output$Table_Number &lt;- renderTable({
  
      predict_table_1&lt;&lt;-NULL
      predict_table_1&lt;&lt;-data.frame(matrix(ncol = 4, nrow = 5))
      #calculation process
      predict_table_1
    })
  
  ###Table 2
    output$Table_Rate &lt;- renderTable({
  
      predict_table_2&lt;&lt;-NULL
      predict_table_2&lt;&lt;-data.frame(matrix(ncol = 4, nrow = 5))
      #calculation process
      predict_table_2
    })
  </code></pre>
  <p>The output$Table_Number &amp; output$Table_Rate look like:
  <a href="https://i.stack.imgur.com/cP4MZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cP4MZ.png" alt="enter image description here" /></a></p>
  <p>What I want to do is, when txt0 is  (Number - based.) and MASE_name[best_model_index] is A, I will change the color of the output$Table_Number =&gt; row A to color Red.</p>
  <p>If txt0 is  (Rate - based.) and MASE_name[best_model_index] is C, I will change the color of the output$Table_Rate =&gt; row C to color Red.</p>
  <p>Thank you guys for answering! :)</p>