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

  • Home
  • SEARCH
  • 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 8482939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:56:58+00:00 2026-06-10T19:56:58+00:00

I need to be able to hide on default specific rows within a table.

  • 0

I need to be able to hide on default specific rows within a table.

Basically this is a “My Basket” page within a e-commerce site and the idea here is to be able to show all instances of more than one of the same product.

Example: Say you choose in quantity to have 3 goats – underneath the product displayed there is a link which says “Show all instances”. What this means is to show each instance of the total 3 goats you want if you were to click on the anchor.

Here is an image of what I’m doing / trying to achieve:

enter image description here

So, the issue I’m having is how to structurally put the “show all instances” rows together in the HTML. Create another table underneath the parent row? I thought this and came into the issue of how to position the “instances” with the correct product.

Here is my HTML code so far – this code just shows what I have done to achieve each product row:

<div class="item-section">
        <span class="section-heading">Smiles Gifts</span>
        <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border-bottom: 1px dotted #666666;padding: 0 0 5px 0;" >
            <tr>
                <th class="col-1">&nbsp;</th>
                <th class="col-2">Qty</th>
                <th class="col-3">Frequency</th>
                <th class="col-4">Card Type</th>
                <th class="col-5">Edit/Remove</th>
                <th class="col-6">Subtotal</th>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td class="item col-1 clearfix">
                    <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td>
                                <img src="images/cart_dummy_image.jpg" alt="" />
                            </td>
                            <td>
                                <span class="product">World Food Programme</span>
                                <!-- LINK TO SHOW OTHER INSTANCES -->
                                <a class="show-instances" href="#">Show all instances</a>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="col-2"">1</td>
                <td class="col-3">One Off</td>
                <td class="col-4">&nbsp;</td>
                <td class="col-5">
                    <a href="#" class="blue-anchor">Edit</a>
                    <a href="#">Remove</a>
                </td>
                <td class="col-6">$45.00</td>
            </tr>
</div>

Hopefully the information provided is detailed enough but if not let me know any questions and I will do my best to assist!

  • 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-06-10T19:57:00+00:00Added an answer on June 10, 2026 at 7:57 pm

    For the HTML simply add more rows for each entry, then you need to do some tweaks in java-script to hide and show those rows. I would prefer jQuery because it handles DOM elegantly.

    Here simple way to accomplish your task, (only posting javascript)

    var link = $('<a class="show-instances" href="#">Show all instances</a>');
    $('tr.main').hide().first().find('.product').parent().remove('a').append(link);
    $('tr.main').first().show();
    
    $('table').on('click', 'a.show-instances', function() {
        var selectedClass = $(this).closest('tr.main').attr('class').split(' ');
        $('.' + selectedClass[1]).not(':has("a.show-instances")').toggle();
        return false;
    });​
    

    Look at the working DEMO

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

Sidebar

Related Questions

I need to be able to hide and show divs on a page. I
I need to be able to hide/show multiple div tags on the same page
Now that I have nginx setup I need to be able to hide my
I need to be able to hide an image that appears when clicking on
I need to be able to hide the navbar and tabbar when I tap
I'm building a treasure hunter app and I need to be able to hide
I need to be able to add javascript to an existing classic asp page
I need to be able to hide 2 options that are displayed from my
I need to be able to hide a row if the numbers in column
I need to be able to hide the soft keyboard in response to clicking

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.