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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:24:01+00:00 2026-05-20T22:24:01+00:00

I have a page with a table on it that has several thousand rows

  • 0

I have a page with a table on it that has several thousand rows of information.

When the user clicks a checkbox, a large amount of the rows can disappear which ends up causing normal browsers to hang for a few seconds but in my original implementation can cause IE to decide it wants to hang for a good 60 seconds (>_>).

JS Fiddle

<html>
<head>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
  <style type='text/css'>
    body{
      font-family: "Arial", sans-serif;
      letter-spacing: 0px;
      font-size: 7pt;
    }

    table{
      border-width: 1px;
      border-color: #000000;
      border-collapse: collapse;
    }

    .tr_1{
      background: #efefef;
    }

    .tr_2{
      background: #ffffff;
    }
  </style>

  <script type='text/javascript'>
    $(function(){
      var $tr_1 = $(".tr_1"),
          $loading = $("#loading");

      $("#checky").click(function(e) {
        $loading.css('display', 'block');

        if(this.checked){
          $tr_1.css('display', 'none');
        }else{
          $tr_1.css('display', 'table-row');
        }

        $loading.css('display', 'none');
      });
    });
  </script>
</head>
<body>
  <div>
    <input type='checkbox' id='checky'>Click Here!
  </div>
  <div id='loading' style='display: none'>
    <h2>Hey! We're loading!</h2>
  </div>
  <table>
    <?php
      for ($i=0; $i<=5000; $i++){
        echo "<tr class='tr_".(($i%2)+1)."'><td>This is a row of data<td>Number $i\n";
      }
    ?>
  </table>
</body>
</html>

Ideally, what I’d like to do is to to have the loading_box appear to give the user some form of idea of what’s currently happening before the browser freezes.

However, as it stands, it doesn’t try and make the loading_box visible until it’s done modifying the rest of the styles (so, it effectively appears and disappears without showing up on the screen).

Is it possible to either:

  1. force the page to display the loading box before it continues with the hiding of the rows
  2. have some more efficient way to get the rows to go to display: none that can potentially stop the page taking an age

With thanks

  • 1 1 Answer
  • 1 View
  • 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-20T22:24:02+00:00Added an answer on May 20, 2026 at 10:24 pm

    You could “delay” the execution of your heavy code until you’re certain the Loading-DIV is shown, by for example using the setTimeout javascript method:

    show div; setTimeout(doStuff, 100);
    

    The above pseudo code would delay the execution of “dostuff” by 100ms.. less could probably do..

    edit: implemented into your example

    $("#loading").css('display', 'block');
    setTimeout(function(){
      if ($(".tr_1").css('display')=='none'){
         $(".tr_1").css('display', 'table-row');
      }else{
         $(".tr_1").css('display', 'none');
      }
      $("#loading").css('display', 'none');
    }, 100);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that has several fixed rows that contain user controls that
I have a site with multiple pages, and each page has a table that
i have a page that displays large datasets into html tables. how can i
I have a table and in the table it has several fields that are
I have a database that has a table that has rows with a value
I have a page that has a table list through AJAX pagination, all custom.
I have a page that has 4 tables. Initially when the page is loaded,
I have a page that builds out a table. Nothing else on that page
I have a page that displays a table in two different modes. In each
I have a page a query that will set a table to 0 or

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.