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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:58:08+00:00 2026-05-10T18:58:08+00:00

I have a really long 3 column table. I would like to <table> <tr><td>Column1</td><td>Column2</td></tr>

  • 0

I have a really long 3 column table. I would like to

<table>     <tr><td>Column1</td><td>Column2</td></tr>     <tr><td>Column1</td><td>Column2</td></tr>     <tr><td>Start</td><td>Hiding</td></tr>     <tr><td>Column1</td><td>Column2</td></tr>     <tr><td>Column1</td><td>Column2</td></tr>     <tr><td>Column1</td><td>Column2</td></tr>     <tr><td>End</td><td>Hiding</td></tr>     <tr><td>Column1</td><td>Column2</td></tr>     <tr><td>Column1</td><td>Column2</td></tr> </table> 

This is the result I’m trying to obtain using jQuery.

Column1  Column2 Column1  Column2 ...Show Full Table... Column1  Column2 Column1  Column2 

I would like to use jQuery’s show/hide feature to minimize the table but still show part of the top and bottom rows. The middle rows should be replace with text like ‘Show Full Table’ and when clicked will expand to show the full table from start to finish.

What is the best way to do this in jQuery?

BTW I’ve already tried adding a class ‘Table_Middle’ to some of the rows but it doesn’t hide it completely the space it occupied is still there and I don’t have the text to give the user a way to expand the table fully.

[EDIT] Added Working Example HTML inspired by Parand’s posted answer

The example below is a complete working example, you don’t even need to download jquery. Just paste into a blank HTML file.

It degrades nicely to show only the full table if Javascript is turned off. If Javascript is on then it hides the middle table rows and adds the show/hide links.

<html>     <head>         <meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>         <title>Example Show/Hide Middle rows of a table using jQuery</title>         <script src='http://code.jquery.com/jquery-latest.js'></script>         <script type='text/javascript'>             $(document).ready(function() {                 $('#HiddenRowsNotice').html('<tr><td colspan='2'> <a href='#'>>> some rows hidden <<</a></td></tr>');                 $('#ShowHide').html('<tr><td colspan='2'><a href='#'>show/hide middle rows</a></td></tr>');                 $('#HiddenRows').hide();                  $('#ShowHide,#HiddenRowsNotice').click( function() {                     $('#HiddenRows').toggle();                       $('#HiddenRowsNotice').toggle();                 });             });         </script>     </head>     <body>         <table>             <tbody id='ShowHide'></tbody>                 <tr><th>Month Name</th><th>Month</th></tr>             <tbody>                 <tr><td>Jan</td><td>1</td></tr>                 </tbody>             <tbody id='HiddenRowsNotice'></tbody>             <tbody id='HiddenRows'>                 <tr><td>Feb</td><td>2</td></tr>                 <tr><td>Mar</td><td>3</td></tr>                 <tr><td>Apr</td><td>4</td></tr>                 </tbody>             <tbody>                 <tr><td>May</td><td>5</td></tr>                         </tbody>         </table>     </body> </html> 

[EDIT] Link my blog post and working example.

  • 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. 2026-05-10T18:58:09+00:00Added an answer on May 10, 2026 at 6:58 pm

    Something like this could work:

    <table>     <tbody>       <tr><td>Column1</td><td>Column2</td></tr>       <tr><td>Column1</td><td>Column2</td></tr>       <tr class='Show_Rows'><td>Start</td><td>Hiding</td></tr>     </tbody>     <tbody class='Table_Middle' style='display:none'>       <tr><td>Column1</td><td>Column2</td></tr>       <tr><td>Column1</td><td>Column2</td></tr>       <tr><td>Column1</td><td>Column2</td></tr>     </tbody>     <tbody>       <tr class='Show_Rows'><td>End</td><td>Hiding</td></tr>       <tr><td>Column1</td><td>Column2</td></tr>       <tr><td>Column1</td><td>Column2</td></tr>     </tbody> </table>   $('#something').click( function() {     $('.Table_Middle').hide();     $('.Show_Rows').show(); });  $('.Show_Rows').click( function() {      $('.Show_Rows').hide();     $('.Table_Middle').show(); }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 281k
  • Answers 281k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer SELECT user_id, auction_id, COUNT(*) FROM ( SELECT @r := @r… May 13, 2026 at 3:55 pm
  • Editorial Team
    Editorial Team added an answer IMO, your code is incorrect. Because, you didn't implement IStateManager… May 13, 2026 at 3:55 pm
  • Editorial Team
    Editorial Team added an answer This is really simple. Use an explicit interface implementation: public… May 13, 2026 at 3:55 pm

Related Questions

I have a table column that needs to be limited to a certain width
Short version: How can I map two columns from table A and B if
I wonder if someone can help: Long story short, I'm using MSSQL2005 to build
Short version: assuming I don't want to keep the data for long, how do

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.