Adding table rows using jQuery - IE7 specific problem
<p>Still getting the hang of jQuery, and I'm having a problem adding rows to a table. I got code from <a href="http://stackoverflow.com/questions/171027/add-table-row-in-jquery">this link on stackoverflow</a>, but it's not working on IE7, which sadly is the one browser is HAS to work in.</p>

<p>I THINK the problem is the jQuery selector for the table, but nothing else I've tried has worked. Any ideas?</p>

<p>Some code:</p>

<pre><code>&lt;table id="payments" class="resultsGrid"&gt;
    &lt;thead&gt;
        &lt;tr class="header"&gt;
            &lt;th style="width: 45px;"&gt;Type&lt;/th&gt;
            &lt;th style="width: 50px;"&gt;Check #&lt;/th&gt;
            &lt;th style="width: 50px;"&gt;Amount&lt;/th&gt;
            &lt;th style="width: 50px;"&gt;Date&lt;/th&gt;
            &lt;th&gt;Notes&lt;/th&gt;
            &lt;th style="width: 48px;"&gt;&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>And the JS:</p>

<pre><code>var table = $("#payments &gt; tbody:last");
    table.empty();

    if (demolition.Payments != null) {
        $("#payments").show();

        for (i = 0; i &lt; demolition.Payments.length; i++) {
            table.append("&lt;tr&gt;");
            // blah blah trimmed
            table.append("&lt;/tr&gt;");
        }
    }
    else {
        table.append("&lt;tr&gt;");
        table.append("&lt;td colspan=\"6\" style=\"padding: 4px;\"&gt;No payments recorded.&lt;/td&gt;");
        table.append("&lt;/tr&gt;");
    }
</code></pre>
