title: Conditional formatting in html table
body: <p>I have done conditional formatting using jquery in a HTML table. It is working fine on the 1st page of datatable, but from the 2nd page, it is not working. I am using this code:</p>
  
  <pre><code>   $("table.dataTable td:nth-child(6)").each(function () {
  
                  if (parseInt($(this).text(), 10) &gt; 0) {
  
                      $(this).parent("tr").css("background-color", "#baf2ef");
                      $('tr').each(function () {
                          var tds = $(this).find('td');
                          var len = tds.length;
  
                          for (var i = 0; i &lt; len; i++) {
                              $(tds[i]).css('text-align', 'center');
                              // $(tds[i]).css('white-space', 'nowrap');
                          }
                      });
                  }
  
                  else {
  
                      $('tr').each(function () {
                          var tds = $(this).find('td');
                          var len = tds.length;
                          for (var i = 0; i &lt; len; i++) {
                              $(tds[i]).css('text-align', 'center');
                              // $(tds[i]).css('white-space', 'nowrap');
                          }
                      });
                  }
              });
  </code></pre>
  
  <p>Please help.</p>