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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:59:07+00:00 2026-05-23T23:59:07+00:00

I have a containing div that is constrained in its height and width. It

  • 0

I have a containing div that is constrained in its height and width. It has 2 child elements.

The first child can be of variable height (as the text within it can wrap, and this is desired behavior).

The second child is a div wrapping a table. The div is set to overflow-y: scroll, so it is meant to fill the remaining height of its container, and provide scrolling for the rest of its inner table when it doesn’t completely fit.

Here’s a simple view of the structure:

<div id="container" style="height:300px; width:200px">
  <div id="headerArea">
    ...
  </div>

  <div id="scrollingTable" style="overflow-y:scroll">
    <table>
      ...
    </table>
  </div>
</div>

Despite my tinkering, I can never get the second child, the scrollingTable div, to constrain itself to the limits provided by the container. Using height:100% doesn’t FILL the remaining container height, but sets the height to the container’s exact height (300px), which is too much because the headerArea takes up space too.

If the height of the headerArea was fixed, I could specify the scrollingTable’s size as 300 – heightOfHeaderArea, but as mentioned above the headerArea’s height is NOT fixed.

I’m likely going to have to use JQuery to resize the scrollingTable to the specified height, but I am curious if there is a pure css solution.

Any suggestions, or is this impossible without fixing the headerArea’s height?

  • 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-23T23:59:09+00:00Added an answer on May 23, 2026 at 11:59 pm

    You can’t do this with css alone. You have to give the scrolling div a height for it to be able to scroll (100% or fixed value).

    http://jsfiddle.net/tUrTu/

    This can be achieved though with javascript :

    http://jsfiddle.net/tUrTu/2/

    Hope it helps.

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

Sidebar

Related Questions

Say I have a div containing an unlimited number of child div s. Is
I have a fixed width DIV containing a table with many columns, and need
If I want to set width of a div containing some text and I
I have div containing a list of flash objects. The list is long so
I have an absolutely positioned div containing several children, one of which is a
I have a dl containing some input boxes that I clone with a bit
I have a div that contains an h3 tag, and i want the h3's
I have a div that I want to write to a popup window (for
I have a project that adds elements to an AutoCad drawing. I noticed that
I have DataTemplate containing a TextBox . I'm setting this template to a listbox

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.