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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:57:43+00:00 2026-05-15T19:57:43+00:00

I am dealing with a pretty standard (or so I thought) page. What I

  • 0

I am dealing with a pretty standard (or so I thought) page. What I would like to do is allow the page to have it’s width determined by the <body> tag and a top level .page style that I’ve defined in my css. My site has a left navigation pane that is ALWAYS a certain width. The “content” area stretches with the page and should determined by the remaining space that consumes the users screen.

I’d like to show scrollbars on content that does not “keep the peace” with my floating area width. For example, I’ve recently come upon a series of sub elements that need scrollbars displayed to keep the page from stretching off into eternity.

Here is a simple image of how things look when scrollbars aren’t needed:
alt text

Here is what it looks like when my sub content is wider than the page:
alt text

What I’d like to do is show scrollbars on the red sections when they fulfill their allowed space (including margins and padding). I would like for everything to be padded nicely against the blue section so that the yellow and white sections don’t get overlapped.

I’ve attached the html that I used to make up this display, because I couldn’t think of a better way to describe my approach:

<html>
<head>
    <style type="text/css">
        body
        {
            background-color: gray;             
        }

        .page /* page is always centered on screen */
        {
            background-color: white;
            width: 90%; 
            margin-left: auto;
            margin-right: auto;
            padding: 10px;
        }

        .nav-pane /* navigation pane is always 100px */
        {
            width: 100px;
            height: 100%;
            background-color: green;
        }

        .nav-pane > div
        {
            width: 100px;
        }

        .content-pane /* content pane should size with page */
        {
            background-color: yellow;
            margin: 10px;         
        }

        .content-pane > div /* !!! SHOULD NOT STRETCH !!! */
        {
            position: relative;
            overflow: auto;
            background-color: blue;
            padding: 10px;
            margin: 10px;
            color: white;
        }

        .content-pane > div > *
        {
            clear: both;
        }

        .content /* content div holds tables, images, paragraphs, etc.. */
        {
            background-color: red;
            float: left;
            margin-bottom: 20px;
        }

        #small /* one is small */
        {
            width: 200px;
        }

        #big /* one is BIG! */
        {
            width: 4000px;
        }
    </style>
</head>
<body>
    <div class="page">
        <table width="100%" style="border: solid black">
            <tr>
                <td class="nav-pane">
                    <div>
                        I am the nav-pane
                    </div>
                </td>
                <td class="content-pane">
                    <div>
                        I am the content pane

                        <h2>I am a heading</h2>
                        <div class="content">
                            <div id="small">Scrollbar not needed</div>
                        </div>

                        <h2>I too am a heading</h2>
                        <div class="content">
                            <div id="big">I require a scroll bar to keep this page pretty... :(</div>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>

Is what I’m trying to do even possible without using javascript?

Thanks in advance for any insight…

  • 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-15T19:57:43+00:00Added an answer on May 15, 2026 at 7:57 pm

    Adding to your table a table-layout: fixed styling should achieve what I believe you are wanting. Add it either inline (like you are already doing) or as part of your css (what I would consider the better way).

    Explanation: Your issue resides in the fact that the div is in a table, which by default a table cell expands to fit its content. Setting the table so that it remains a fixed size by using the table-layout property prevents the table from increasing size. Of course, the scroll bar that comes from it will actually be on the table, not the div.

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

Sidebar

Related Questions

I have a UITableView populated with a standard NSFetchedResultsController. However I'd like to prepend
I have a pretty strage problem im dealing with. Lost sessionvariables in firefox. Im
I have a pretty simple little schema that looks like this: Trail --> Segment
Hallo everybody, I'm dealing with a pretty strange situation here. I have developed a
Other questions dealing with use of match_parent pre 2.2 have answers stating one should
I am dealing with very primitive HTML construction that goes like this: <a NAME=header1></a><b><font
I have a one-many relationship in my local Sqlite db. Pretty basic stuff. When
I have a pretty big chat app I'm working on, and had a question
When dealing with debugging queries using Profiler and SSMS, its pretty common for me
I have two tables I'm dealing with, patientTbl which consists of a PK called

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.