Remove table row that contains a table
<p>I have html that displays a table similar to:</p>

<pre><code>&lt;table&gt;
&lt;tr&gt;
    &lt;th&gt;col1&lt;/th&gt;
    &lt;th&gt;col2&lt;/ht&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;0001&lt;/td&gt;
    &lt;td&gt;Test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td colspan="2" id="detailsTable"&gt;
        &lt;table&gt;
            &lt;tr&gt;
                &lt;th&gt;one&lt;/th&gt;
                &lt;th&gt;two&lt;/th&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;xxxxxx&lt;/td&gt;
                &lt;td&gt;xxxxxxx&lt;/td&gt;
            &lt;/tr&gt;               
        &lt;/table&gt;
    &lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p></p>

<p>There is a column of expand and contract buttons on the outer table so that the nested table is only shown when the user clicks to expand.</p>

<p>The expansion works and the table gets displayed. However when when I try and remove the row from the outer table that contains the child table it doesn't work.</p>

<p>I had code like:</p>

<pre><code>var rowIndex = $(this).parent().parent().prevAll().length;
$("table[id$=gvParentAccounts] tr").eq(rowIndex + 1).remove();
</code></pre>

<p>If the row only contains text it works as I'd like and removes the row, however if like in this case the row contains a table it is unable to remove the row as required.</p>

<p>I'm using ASP.Net and jQuery for this. </p>

<p>Thanks 
Alan.</p>
