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

The Archive Base Latest Questions

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

I’m using a HTML Table with several rows. Every second row – containing details

  • 0

I’m using a HTML Table with several rows. Every second row – containing details about the preceding row – is hidden using CSS.

When clicking the first row, the second row gets showed using jQuery show(). This is quite nice, but I would prefer the slideDown-Effect.

The problem is, inside the details row, there are two floating DIVs, one floating on the left, and one on the right. Now if i slideDown the previously hidden row, the contained DIVs behave strange and “jump around”. See this animated gif to understand what I mean: http://ich-wars-nicht.ch/tmp/lunapic_127365879362365_.gif

The markup:

<tr class="row-vm">
    <td>...</td>
    ...
</tr>
<tr class="row-details">
    <td colspan="8">
        <div class="vmdetail-left">
        ...
        </div>
        <div class="vmdetail-right">
        ...
        </div>
    </td>
</tr>

The CSS:

.table-vmlist tr.row-details { display: none; }
div.vmdetail-left { float: left; width: 50%; }
div.vmdetail-right { float: right; width: 50%; }

And the jQuery code:

if ($(this).next().css('display') == 'none')
{
    // Show details
    //$(this).next().show();
    $(this).next().slideDown();
}
else
{
    // Hide details
    //$(this).next().hide();
    $(this).next().slideUp();
}

Is there a way to fix this behavior, and to implement a nice slideDown-effect?

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

    Summary: show/hide the tr, animate the divs within with slideUp/slideDown

    The markup: The same

    The CSS:

    .table-vmlist tr.row-vm { cursor:pointer; }
    .table-vmlist tr.row-details { display: none; }
    div.vmdetail-left { float: left; width: 50%; display:none; }
    div.vmdetail-right { float: right; width: 50%; display:none; }
    

    (divs start off hidden. Also added pointer cursor to clickable tr for usability)

    And the jQuery:

    $('tr.row-vm').bind('click',function(e){
        if ($(this).next().css('display') == 'none')
        {
            // Show tr, slideDown inner divs
            $(this).next().show().find('div').slideDown('slow');
        }
        else
        {
            // slideUp inner divs, hide parent tr after animation complete
            $(this).next().find('div').slideUp('slow',function(){
                $(this).parent().parent().hide();
            });
        }
    });
    

    (Note that direct parent of divs is the td, so parent called twice to access tr. Also added slide speed.)

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There's something wrong with your calculation, it should not turn… May 15, 2026 at 3:08 pm
  • Editorial Team
    Editorial Team added an answer Try to use a loop, let, and printf for the… May 15, 2026 at 3:08 pm
  • Editorial Team
    Editorial Team added an answer Assuming you didn't remove the path from your code and… May 15, 2026 at 3:08 pm

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.