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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:56:40+00:00 2026-06-18T09:56:40+00:00

I have a (long) Bootstrap table for which I want to allow for scrolling

  • 0

I have a (long) Bootstrap table for which I want to allow for scrolling with overflow: auto;. I only want the tbody to be scrollable, not thead content.

Please see this fiddle for my attempt. I have tried to set a height on tbody unsuccessfully.

  • 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-18T09:56:41+00:00Added an answer on June 18, 2026 at 9:56 am

    You can’t set tbody as scrollable. You need to create two separate tables — one for the header and one for the body. Wrap the body table in a div and set the overflow-y property to scroll.

    Updated jsfiddle: http://jsfiddle.net/SzGW3/37/

    Markup:

    <div class="scrollable">
        <table class="table table-hover table-striped">
            <thead>
                <tr>
                    <th>User</th>
                    <th>Rights</th>
                    <th></th>
                </tr>
            </thead>
        </table>
    </div>
    <div class="bodycontainer scrollable">
        <table class="table table-hover table">
            <tbody id="user-rows">
                <tr class="user-row" style="opacity: 1;">
                    <td>Justin</td>
                    <td>Administrator</td>
                    <td><span class="btn btn-mini btn-primary edit pull-right fade">Edit</span>
                    </td>
                </tr>
                <tr class="user-row" style="opacity: 1;">
                    <td>Sebastien</td>
                    <td>Administrator</td>
                    <td><span class="btn btn-mini btn-primary edit pull-right fade">Edit</span>
                    </td>
                </tr>
                <tr class="user-row" style="opacity: 1;">
                    <td>Steve</td>
                    <td>Operator</td>
                    <td><span class="btn btn-mini btn-primary edit pull-right fade">Edit</span>
                    </td>
                </tr>
                <tr class="user-row" style="opacity: 1;">
                    <td>Thomas</td>
                    <td>Administrator</td>
                    <td><span class="btn btn-mini btn-primary edit pull-right fade">Edit</span>
                    </td>
                </tr>
                <tr class="user-row" style="opacity: 1;">
                    <td>admin</td>
                    <td>Administrator</td>
                    <td><span class="btn btn-mini btn-primary edit pull-right fade">Edit</span>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    

    Style:

    @import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');
    
    .scrollable {
        overflow-y: scroll;
    }
    
    .bodycontainer {
        height: 100px !important;
        width: 100%;
    }
    

    The scroll bar on the header is to keep the widths the same. You can fix that with some JavaScript, but there should also be some nice JS / JQuery libraries you can find to handle the entire tbody scrolling issue for you.

    If you want to set the same width for header cols (th) and cols (td):

    table thead>tr>th{
        width: 20% !important; /* 20% for 5, 25% for 4, etc */
    
    }
    
    table tbody>tr>td{
        width: 20% !important; /* 20% for 5, 25% for 4, etc */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have long-lasting TCP connection between two computers (second not under my control). Second
One thing with which I have long had problems, within the CakePHP framework, is
I have long data that I want to see in TextView . I am
I have long running workflow which is persisted into database using SqlWorkflowInstanceStore, the problem
I have long page. I want show some info, so when user scroll page,
I have long titles and want truncate them but in a way that no
I have long cycles of GC. from checks I saw there are too many
Apple have long blocked mobile Safari from playing sounds – the usual JavaScript commands
I have long HTTP request ( generating large Excel file - about 60K records
I have long file with the following list: /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl()

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.