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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:31:55+00:00 2026-05-25T02:31:55+00:00

#main { margin: auto; padding: 0; width: 95%; } #left-wrapper { display: block; }

  • 0
#main {
margin: auto;
padding: 0;
width: 95%;
}
#left-wrapper {
display: block;
}
#content {
height: 500px;
white-space: nowrap;
overflow-y: auto;
overflow-x: scroll;
}

<div id="main">
    <table>
        <tr>
            <td>
                <div id='left-wrapper'>
                </div>
            </td>
            <td>
                <div id='content'>
                    <table>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
    </table>
</div>

The content wrapper contains a table which holds some data which size is unknown, and must not be wrapped so white-space:nowrap is set, and it works fine. The height of the content div has a fixed size and the vertical scrollbar appears ok. The main div’s width is set to 95%. The problem is that the content div does not activates the scrollbar when the data is too long to fit, instead it resizes itself to the right side of the screen, even if the wrapper main div’s width is set to 95%. Is there a way to activate the content div’s horizontal scrollbar without setting it’s width? It’s maximum width should be in line with the width of the main wrapper, it would not be a problem even if it has a fixed width, but then it must fill the remaining area to be in line with it’s wrapper main div which as I mentioned has it’s width set to 95%.
I searched everywhere, days are passing and I simply can’t figure out a right solution. Please if anyone has a suggestion I would appreciate it very much. Thanks.

  • 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-25T02:31:56+00:00Added an answer on May 25, 2026 at 2:31 am

    The inner <div> will stay inside the container <div> with the CSS you have. But, because you have a <table> surrounding the inner <div> it doesn’t behave as expected.

    I think the solution may be to layout the page without the <table>.

    This example shows the inner <div> being constrained inside the outer <div> using your current CSS.

    <html>
    <head>
        <style>
        #main {border:solid 2px orange; margin: auto;   padding: 0; width: 190px;}
        #left-wrapper {display: block;}
        #content {border:solid 2px purple;  height: 500px; white-space: nowrap; overflow-y: auto;   overflow-x: scroll;}
        </style>
    </head>
    <body>
        <div id="main">
    
          <div id='content'>
             <table style="border:solid 1px #ddd;">
                <tr style="background-color:#ccccff;">
                   <td>column A</td>
                   <td>column B</td>
                   <td>column C</td>
                   <td>column D</td>
                   <td>column E</td>
                </tr>
                <tr>
                   <td>1</td><td>2</td><td>3</td><td>2</td><td>3</td>
                </tr>
                <tr>
                   <td>11</td><td>12</td><td>11</td><td>12</td><td>13</td>
                </tr>
             </table>
          </div>
    
        </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please can you tell me why the dark blue background (between the main white
my site's main div is floated left in some page and right in some
I want to achieve this: I want to display boxes, one main box and
Why is my footer not displaying full page width in IE8: Display: http://cl.ly/0J2Z0l1w3S1e0A3d3Q1V HTML:
How can the parent div auto resize it's height based on the child's height?
I am trying to make a 3 column layout webpage with percentage wrapper width,
The main web application of my company is crying out for a nifty set
My main JavaScript framework is jQuery , so I would like my unit test
function main() { Hello(); } function Hello() { // How do you find out
The main user-case is: Create the 2D floor plan See the 3D view of

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.