How can I give style all td tags in a tr tag via jQuery?
<p>I'm trying to give style to the cells in specific table rows via jQuery.</p>

<p>The catch is that I need to check an attribute row by row and if I found something I expect, the row <strong>BEFORE</strong> the current one should be re-styled.</p>

<p>I'm using the following code but instead of draw the border only for the cells of the row, it draws it for every cell in the table:</p>

<pre><code>$(".some_class_for_every_row_in_the_table").each(function() {
    var control_variable = ... //This is the attribute
    if (control_variable) {
        $(previous_row).find('td').each(function() {$(this).css('border-bottom', "1px solid #AAAAAA")});
    }
    previous_row = this; 
...
})
</code></pre>

<p>This is the HTML of the table:</p>

<pre><code>&lt;table&gt;
    ...
    &lt;tbody&gt;
        &lt;tr control_variable="..."&gt;
          &lt;td&gt;...&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr control_variable="..."&gt;
          &lt;td&gt;...&lt;/td&gt;
        &lt;/tr&gt;
        ...
   &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>The <code>control_variable</code> is gotten with the correct value and previous_row maintains consistency at all times.</p>

<p>I'm sorry if I mis leaded with the first version of the question.</p>

<p>What is the problem with my code?</p>
