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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:32:32+00:00 2026-05-23T09:32:32+00:00

A web site of mine has tables nested within absolutely-positioned draggable dialogs that show/hide

  • 0

A web site of mine has tables nested within absolutely-positioned draggable dialogs that show/hide based on some user interactions. It’s worth mentioning that these tables have table-layout: auto; and width: auto;. A problem arose where a table had so many rows that it went off the bottom edge of the screen. This caused issues with the dragging since we have limited the dragging to the edges of the viewport. To fix the issue, I wrapped the table in a <div> and set max-height: 400px; overflow: auto; on it. This gives the user a nice vertical scroll bar whenever the table exceeds the max-height. That works, but for some reason the browser (both IE and Chrome) is not taking the width of the scroll bar into consideration, so anytime the height of the table exceeds the max and triggers an overflow, the table gets scrunched over to the left and some cells in the first column have a very ugly word-wrap applied to them. Without the overflow/max-height combination, the table width is calculated correctly and there is no overflow.

Live Demo on jsFiddle

I found two ways around this, both of which are not feasible…

  1. Explicitly set the width on each of the cells (or use table-layout: fixed)
  2. Use overflow-y: scroll; instead of auto which causes the scroll bar to always appear, even when it is not needed. What makes this worse is that overflow-y is a CSS3 property.

There must be a better solution! How can I get a vertical scrollbar on the parent of my table without any word-wrapping?

  • 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-23T09:32:32+00:00Added an answer on May 23, 2026 at 9:32 am

    Figured it out, thanks in part to kei’s answer. Using white-space: nowrap; does indeed prevent the text from wrapping, but it causes a horizontal scrollbar to appear (demo). To remove the horizontal scrollbar, I just applied 18px of right padding to the table parent and now everything works perfect (demo). Thanks to all who helped!

    div.dialogBody {
      overflow: auto;
      padding-right: 18px;
      max-height: 400px;
    }
    
    div.dialogBody table td,
    div.dialogBody table th {
      white-space: nowrap;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A friend of mine has a static web site. She would like to add
My web site has a database lookup; filling out a CAPTCHA gives you 5
I have a web site in asp.net that uses a master page. In this
I writing a web site that uses Active Directory to validate users. I don't
On a PHP-based web site, I want to send users a download package after
I have a server hosting a website of mine that has almost zero-traffic. A
A friend of mine asked to create a static website and I found that
I am developing a web site and need to see how it will look
I have a web site using apache httpd as the server and mysql as
The win32.perl.org web site provides references to several Perl distributions for MS Windows. For

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.