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 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

Related Questions

I have a really long string of text that I would like to update
I have this case <WrapPanel> <CheckBox>Really long name</CheckBox> <CheckBox>Short</CheckBox> <CheckBox>Longer again</CheckBox> <CheckBox>Foo</CheckBox> <Slider MinWidth=200
I have a really long table in LaTeX that spans several pages and is
I have a 2 column table in a database 1,000 rows long(All integer data).
I have a really long port map where I want to replace a bunch
I have a really long integration test that simulates a sequential process involving many
So I have a really long chain of methods, something similar to: return self.append_command(fbghasjfa).append_command(input_file_part).append_command(output_video_codec_part).append_command(output_resolution_part).append_command(output_video_bitrate_part).append_command(strict_part).append_command(output_audio_codec_part).append_command(output_number_of_audio_channels_part).append_command(output_audio_bitrate_part).append_command(output_file_part).__finalized
I have a block of text which occasionally has a really long word/web address
I have a rather long switch-case statement. Some of the cases are really short
I have really no idea why I'm asking this as this a really completely

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.