title: Datatable change a row color with rowcallback
body: <p>I am using datatables and currently stuck in changing a row to another color if a STATEMENT meet the requirement, already tried many things but it has really weird error, my codes are :</p>
  
  <pre><code>"rowCallback": function( row, data, index ) {
          if ( data[2] &lt; data[4] ) {
            $('td', row).css('background-color', 'pink');
          }
  }
  </code></pre>
  
  <p>While in my response file, i wrote this query :</p>
  
  <pre><code>$sql = "SELECT itemid,itemname,stock,unit,minimum FROM item WHERE type LIKE 'homecare'";
  </code></pre>
  
  <p>I want to change the row color if the item's stock is LOWER than the minimum value set by the user.</p>
  
  <p>My current datatable test results are :
  <a href="https://i.stack.imgur.com/Z6rq3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z6rq3.png" alt="enter image description here"></a></p>
  
  <p>Example test result i have run :</p>
  
  <ul>
  <li>Below 10 and Above Minimum = Unchanged</li>
  <li>10 and Above = Red &lt;&lt; it should be Unchanged, because it is above minimum</li>
  <li>50 and Above = Unchanged</li>
  </ul>
  
  <p>While the database settings for both row 'minimum' column are the same number (5)</p>
  
  <p>Thanks for your help!</p>