change cell color based on condition
<p>I have a condition that changes the background color of the table rows based on comparing values. I want to integrate another condition that compares two cells and returns a background color on only those cells..</p>

<p>I already have a loop running on the table</p>

<pre><code>            for (i = 0; i &lt; rows.length; i++) {
            cells = rows[i].getElementsByTagName('td');
</code></pre>

<p>This is what i have but its applying the color results to the entire column rather than each cell..</p>

<pre><code>         if (cells[10].innertext !== cells[11].innerText)
                cells[10].style.backgroundColor = "red";
                cells[11].style.backgroundColor = "red";

         else 
            (cells[10].innertext == cells[11].innerText)
                cells[10].style.backgroundColor = "green";
                cells[11].style.backgroundColor = "green";
</code></pre>

<p>thanks for the help!</p>
