Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:28:24+00:00 2026-05-23T10:28:24+00:00

I have html that displays a table similar to: <table> <tr> <th>col1</th> <th>col2</ht> </tr>

  • 0

I have html that displays a table similar to:

<table>
<tr>
    <th>col1</th>
    <th>col2</ht>
</tr>
<tr>
    <td>0001</td>
    <td>Test</td>
</tr>
<tr>
    <td colspan="2" id="detailsTable">
        <table>
            <tr>
                <th>one</th>
                <th>two</th>
            </tr>
            <tr>
                <td>xxxxxx</td>
                <td>xxxxxxx</td>
            </tr>               
        </table>
    </td>
</tr>

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.

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.

I had code like:

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

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.

I’m using ASP.Net and jQuery for this.

Thanks
Alan.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:28:25+00:00Added an answer on May 23, 2026 at 10:28 am

    How about:

    $(this).parent().parent().remove();
    

    I’m not sure if this is exactly what you have, but here’s a JSFiddle demonstrating that it works:

    http://jsfiddle.net/9TQG9/1/

    EDIT: Actually this:

    $(this).parents("tr").eq(0).remove();
    

    would be much nicer and more reliable. See here:

    http://jsfiddle.net/9TQG9/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML table that displays information from a database, and one of
I have some HTML that I need to toggle between two structures - one
I have a HTML table that displays rows of records and has a column
I have a website that displays pictures in an html table. When I click
I have an html table that displays maintenance records. There are 3 columns that
I have a very straightforward HTML page that displays content in two columns. To
I have a table similar to: ID...NAME.....HTMLTEXT 1....Footer....`<b>test</b>` where each entry has some HTML
i have a page that displays large datasets into html tables. how can i
I have a page that displays XML info in a table. The XML files
I have a table in a cell that displays the numbers a user enters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.