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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:58:09+00:00 2026-06-14T14:58:09+00:00

I have a simple div tag: I need to make the thead fixed and

  • 0

I have a simple div tag:
I need to make the thead fixed and above the tbody.
I need to have them within the same div, same table.
With the below code, my header is over the body. How Can I push the tbody down a few notches, so when i scroll the header is fixed and only the body moves

<div STYLE=" height: 120px; width: 100px; font-size: 12px; overflow: auto;">
  <table bgcolor="green">
    <thead style="position:fixed;">
        <tr><td bgcolor="#fafafa">hello</td></tr>
    </thead>
    <tbody >
   <tr><td bgcolor="#dadada">www.hioxindia.com</td></tr>
   <tr><td >maths.hscripts.com</td></tr>
   <tr><td bgcolor="#dadada">www.hscripts.com</td></tr>
   <tr><td>free php scripts</td></tr>
   <tr><td bgcolor="#dadada">www.hiox4u.com</td></tr>
   </tbody>
</table>
</div>

Has to work on IE
For the above div… I need to add scroll with fixed header on top of the table. No additional divs or table should be included inbetween. I need the thead and tbody to be within the same table

  • 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-14T14:58:10+00:00Added an answer on June 14, 2026 at 2:58 pm

    Using your code as a basis, here is a jsfiddle I’ve tested in Chrome and IE10 and it works there at least.

    JSFiddle:
    http://jsfiddle.net/YbQzF/

    code:

    <div STYLE=" height: 120px; width: 100px; font-size: 12px; overflow: auto;">
      <table bgcolor="green">
        <thead style="position: fixed">
            <tr><td bgcolor="#fafafa">hello</td></tr>
        </thead>
        <tbody style="overflow:scroll; max-height:100px; position:absolute; top:20px;">
       <tr><td bgcolor="#dadada">www.hioxindia.com</td></tr>
       <tr><td >maths.hscripts.com</td></tr>
       <tr><td bgcolor="#dadada">www.hscripts.com</td></tr>
       <tr><td>free php scripts</td></tr>
       <tr><td bgcolor="#dadada">www.hiox4u.com</td></tr>
       <tr><td>free php scripts</td></tr>
       <tr><td bgcolor="#dadada">www.hiox4u.com</td></tr>
       <tr><td>free php scripts</td></tr>
       <tr><td bgcolor="#dadada">www.hiox4u.com</td></tr>
    ...
       </tbody>
    </table>
    </div>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple layout using the HTML div tag. I would like
I have an anchor tag with some simple CSS: div { background-color: gray; /*
I current have a need to have a contenteditable div tag inside an li
I have a simple div tag. Can you please tell me how can I
I have a simple set of images nested in a div tag, I'm just
I have several div tags containing simple html/css content and I need a simple
I have simple HTML page with svg like this: <div id=plan> <svg xmlns=http://www.w3.org/2000/svg version=1.1>
I have a simple jquery animation on a div, which is inside a div,
I have this simple html: <div class=wrapper> <span class=higher> [higher] <span class=lower> hello </span>
I have a simple request(still learning javascript). I have a title div and 3

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.