Style column with jQuery
<p>I need to style an entire column in a table. The column should correspond to the element with <strong><code>id="current"</code></strong> in the <strong><code>thead</code></strong> row.</p>

<pre><code>&lt;table&gt;
&lt;thead&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;div id="current"&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>Now, I can add a class to the correct column, I just need to figure out a way to tell the column count number.</p>

<pre><code>var num = ???
$('td:nth-child(num)').addClass('selectedCol');
</code></pre>
