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 3424226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:26:57+00:00 2026-05-18T06:26:57+00:00

I am nesting tables within tables and want to toggle the them when you

  • 0

I am nesting tables within tables and want to toggle the them when you click on a <th class="folder">

    $('table').each(function(){
        $('th.folder', this).bind('click', function(){
            $(this).closest('table').children('tbody').toggle();
        });
    });

Here is some typical HTML:

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th class="type">Type</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <table>
          <thead>
            <tr>
              <th class="folder" colspan="2">Deal flow</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>item 1</td>
              <td>image</td>
            </tr>
            <tr>
              <td>item 2</td>
              <td>image</td>
            </tr>
          </tbody>
        </table>
        <table>
          <thead>
            <tr>
              <th class="folder" colspan="2">Rejected deals</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>item 3</td>
              <td>image</td>
            </tr>
            <tr>
              <td>item 4</td>
              <td>image</td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>

Doesn’t seem to work and I can’t figure out why! Any ideas?

  • 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-18T06:26:58+00:00Added an answer on May 18, 2026 at 6:26 am

    See Working Example


    Try this instead:

      $('.folder').bind('click', function(){
         $(this).closest('table').children('tbody').toggle();
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to store a lua table where the keys are other lua tables.
This is my table where i want my PNRNo to be generated as 'PNRRES001'
I have a class that contains hierarchical data. I want to present this data
When writing views and nesting views within deeper views I sometimes miss something and
So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html Here is the example: <definition name=myapp.homepage template=/layouts/classic.jsp> <put-attribute name=title
I have the following 3 tables: 1) Sweetness Table FruitIndex CountryIndex Sweetness 1 1
I'm trying to transform a table to an XML struture and I want one
Here's my current fiddle: http://jsfiddle.net/UjAQf/79/ My target table design is this: But I'm having
Jquery UI Dialog modal-form doesn't shows up inside table, but works fine outside. This
I have a set of image paths stored in a table like this: +---------------------------------------------------------+

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.