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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:37:06+00:00 2026-05-21T10:37:06+00:00

I have a TABLE with multiple rows. Within each row one of the TD

  • 0

I have a TABLE with multiple rows. Within each row one of the TD elements contains several DIV elements that:

  1. can have any dimension but all of them (within one TD) have the same pixel dimension
  2. have to be positioned one on top of the other
  3. containing TD needs to resize according to child DIV elements
  4. One DIV will be displayed at a time (statically)
  5. when changing from one to the other fading will be used (so two of them will be displayed at the same time)
  6. there will never be more than two of them displayed at the same time

This is a simplified example of such a table

<table>
    <tr>
        <td>Name</td>
        <td>
            <div>First</div>
            <div>Second</div>
            ...
            <div>Last</div>
        </td>
        <td>Additionals</td>
    </tr>
    <tr>
        <td>Name</td>
        <td>
            <div>First</div>
            <div>Second</div>
            ...
            <div>Last</div>
        </td>
        <td>Additionals</td>
    </tr>
    ...
</table>

The obvious solution would be to set

div
{
    position: absolute;
}

This will automatically position DIV elements on top of each other (according to flow layout), but TD dimension will stay as if it contains no child elements. Overflow doesn’t do anything because child elements are absolutely positioned.

td
{
    overflow: auto;
}

How should I make this work?

  • 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-21T10:37:07+00:00Added an answer on May 21, 2026 at 10:37 am

    Do you know the size of the divs before hand? If so, you can just give a wrapper div those dimensions:

    <td>
        <div class="wrapper">
           <div>1</div>
           <div>2</div>
           <div>3</div>
        etc...
    

    If you don’t won’t know the size, then, since you are already using JS, you could grab the size of the first child div of wrapper and then set the wrapper dimensions via JS.

    UPDATE:

    The only way I can think of doing this with CSS all by itself would be to have the first DIV render twice. The first instance set to position: relative, and then it’s duplicate, like the rest, can be set to position: absolute. This clone then acts like a shim. You could set visibility: hidden if you want to make sure it doesn’t show up visually (but still takes up the proper space). The drawback to this, however, is that you now have content duplicated on your page, which may not be ideal from an SEO and/or accessibility POV.

    I’d probably go the JS route and grab the dimensions after the page loads.

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

Sidebar

Related Questions

I have a table with multiple rows. Each row is a form. I want
I have multiple rows in a table, in one of which is a link
I have a table with multiple tbody's, each of which has a classed row,
I have a script that appends some rows to a table. One of the
I have a table with game scores, allowing multiple rows per account id: scores
I have a table with a Date column. Each Date may appear multiple times.
A table that extends onto multiple printed pages will have its thead and tfoot
I have a table UserAliases ( UserId, Alias ) with multiple aliases per user.
I have a table with columns Index, Date where an Index may have multiple
Below is my table, a User could have multiple profiles in certain languages, non-English

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.