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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:28:25+00:00 2026-05-14T21:28:25+00:00

I have a table with row which cab be hidden by user. It’s implemented

  • 0

I have a table with row which cab be hidden by user. It’s implemented this way:

Markup:

<table>
   <tr>
      <td>
         <table style="margin-left: auto; text-align: right;">
            <tr>
               <td class="stats-hide">
                  <a href="#" onclick="hideStats();">Hide</a>
               </td>
               <td class="stats-show" style="display: none;">
                  <a href="#" onclick="showStats();">Show</a>
               </td>
            </tr>
         </table>
      </td>
   </tr>
   <tr class="stats-hide">
      <td>
        <!-- data -->
      </td>
   </tr>
</table>

And jQuery code:

<script type="text/javascript" language="javascript">
    function hideStats() {
        hideControls(true, $('.stats-hide'));
        hideControls(false, $('.stats-show'));
    }

    function showStats() {
        hideControls(false, $('.stats-hide'));
        hideControls(true, $('.stats-show'));
    }

    function hideControls(value, arr) {
        $(arr).each(function () {
            if (value) {
                $(this).hide();
            }
            else {
                $(this).show();
            }
        });
 }
</script>

How to implement the same behavior with one, single link and one, probably, CSS class?

My idea – store somewhere a boolean variable and toggle controls visibility relatively to this variable. Are there more?

  • 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-14T21:28:25+00:00Added an answer on May 14, 2026 at 9:28 pm

    Is the row hiding not working properly on IE? What is the version of jQuery and the browser which is troublesome?

    I created an example using toggle as suggested by @Galen and it works on Chrome, Firefox, and Safari. I don’t have access to IE.

    Here’s the code:

    HTML

    <table>
       <tr>
          <td>
             <table class="data">
                <tr>
                   <td class="stats-hide">
                      <a href="#" class="toggle-stats">Hide</a>
                   </td>
                   <td class="stats-show">
                      <a href="#" class="toggle-stats">Show</a>
                   </td>
                </tr>
             </table>
          </td>
       </tr>
       <tr class="stats-hide">
          <td>
            Some Data
          </td>
       </tr>
    </table>
    

    Javascript

    $(".toggle-stats").click(function() {
        $(".stats-hide, .stats-show").toggle();
    });
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a table layout in which my table row height is too
I'm having a table and i have a row which is initially set to
I have a DB table in which each row has a randomly generated primary
I have a table for which I want to display only the first row
I have a table which is being dynamically populated, each row contains two textfields
Ok, I have a table which contains multiple rows. Each row contains some data
i have a table which looks similar to this <asp:TableRow><asp:TableCell>Question 1</asp:TableCell><asp:TableCell ID =Question1Text></asp:TableCell></asp:TableRow> <asp:TableRow><asp:TableCell
I have a table row that needs to be hidden when the anchor with
I have table data which looks like this id | keyword | count |
I have a table row which has class='highlightedrows' within my html I am trying

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.