Insert new column in Table
<p>I have a problem where the <code>:eq()</code> does not accept the counter, <code>n</code>, to insert values to a new column to the table in the HTML. </p>

<pre><code>$(document).ready(function() {  
    var $tablerow = $('table.table').find('tr');
    count = 0;

    $tablerow.each(function(index, value){
        count += 1;
        var $listitem = $(this);
        n = parseInt($listitem.index());
        var $newRow = $("&lt;td&gt;" + n + "&lt;/td&gt;");
        $("table.table tr:eq(n)").append($newRow);
    });
});  
</code></pre>

<p>HTML</p>

<pre><code>&lt;table class="table"&gt;
    &lt;tr&gt;&lt;td&gt;First row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;second row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;third row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;fourth row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;fifth row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;sixth row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;seventh row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;eighth row&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>
