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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:19:35+00:00 2026-06-15T09:19:35+00:00

Check out the small html structure sample below for context. Check out this fiddle

  • 0

Check out the small html structure sample below for context. Check out this fiddle for and example of the problem.

Short explanation for fiddle users:

  1. Scroll left – vertical scroll bar not visible
  2. Scroll right – vertical visible
  3. I want the vertical scroll bar always visible
  4. Requirement – The header must remain fixed (visible while scrolling)

Long explanation:

I have a table with a fixed header and a scrollable body. The complexities of that requires two tables. That’s all good. In my cause I also have resizable columns. table-layout: fixed for that to work. This is were problems arise.

To make the scrolling body work I’ve got a div that wraps the .rows table for scrolling. This works great until the grid, specifically the .rows table, overflows in the x direction. In this case the the vertical scroll bar is only visible if the grid is scrolled all the way to the right. Because the scroll bar is on the .row-wrapper div. And that overflow is being hidden by the .grid div. I’d like the scrollbar to be on the .grid-canvas div so that it is visible even when scrolled to the left side.

<div class=grid>
    <div class=grid-canvas>
        <table class=header></table>
        <div class=row-wrapper>
            <table class=rows></table>
        </div>
    </div>
</div>

side note: If you set the table display to block then the wrapping div isn’t needed unless you want to support IE8 which I do. Maybe there’s a way around that but that another question for another time.

  • 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-06-15T09:19:35+00:00Added an answer on June 15, 2026 at 9:19 am

    Well after hours of hacking with no luck I decided to disect some of the existing libraries to see how they were accomplishing this. Unfortunately I was sorely disappointed. All of them were using javascript.

    The up side to this is that the it only requires a small bit of code not that that means it will perform well. To make this perform as well as possible I’m updating the header when required in the x direction. Since this will typically be a small area in my case it should be good enough.

    Hundredth times a charm!

    fiddle

    Here’s the basic:

    HTML

    <div class=grid>
        <div class=grid-canvas>
            <div class=header-wrapper>
                <table class=header></table>
            </div>
            <div class=row-wrapper>
              <table class=rows></table>
            </div>
        </div>
    </div>
    

    Javascript

    $headerDiv = $('.header-wrapper');
    $rowDiv = $('.row-wrapper');
    $rowDiv.scroll(function(e) {
        $headerDiv.css({
            left: -$rowDiv[0].scrollLeft + 'px'
        });
    });​
    

    CSS

    .grid {
      height: 500px;
      width: 350px;
    }
    
    .grid-canvas {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
    }
    
    .header-wrapper {
      position: absolute;
      top: 0;
      width: auto;
      background-color: white;
      z-index: 1;
    }
    
    .row-wrapper {
      position: absolute;
      top: 0;
      height: 100%;
      width: 100%;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      overflow: auto;
      padding-top: 18px;
      background-color: lightgreen;
    }
    
    th, td {
      width: 80px;
      min-width: 80px;
      max-width: 80px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    

    ​

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

Sidebar

Related Questions

Brand new to android and facing a weird problem.Check out the code below FirstActivity.java:
Check out this jsbin . I have a form with a custom button that
Check out this demo by FaTaL. It is explained in his blog that he
check out the following test: http://binks.knobbits.org/webgl/texture3.html It's a simple test of cube textures. It
Check out this piece of JavaScript code: (function (w, d) { var loader =
Can check out here alt text http://51hired.com/static/problem.bmp
This problem only occurs in IE8+. It works fine in Firefox. HTML: <fieldset> <legend>Hello</legend>
I would like to add a small code snip to check out whether an
Could some on with Firebug or other tool check out this page. Take a
I configured an instance of Tomcat following this article: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html . I commented out

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.