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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:27:42+00:00 2026-06-04T05:27:42+00:00

Hi I need a strategy for a fixed table header, here are the strategies

  • 0

Hi I need a strategy for a fixed table header,

here are the strategies that have not worked for me, mainly because of certain functionality contraints:

  • Copying the header and move the header according to the scrolltop

(the issue I have with this one is because of the input texts that are in the header. When I clone the header, it also clones the input form, the server-side always get the wrong session values.)

  • Using the overflow-y and have the content scroll

(the problem with this one is because of the cell sizes, some of the cell sizes are dependent on the size of the header. Therefore, when I do position:absolute, the size of the cells doesn’t correspond to the size of the headers. Assigning a fixed length is really thought because the cells are generated dynamically)

PS: don’t ask me why I didn’t use a jQuery plugin, I have to code on top of the legacy code. I’m plainly running out of ideas.

  • 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-04T05:27:44+00:00Added an answer on June 4, 2026 at 5:27 am

    Edit:

    Refer this (not my suggestion)

    This works for me (on chrome and firefox). I guess its very bad approach but worth sharing.

    Markup:

    <table>
            <thead>
                <tr><th>head1</th><th>head2</th></tr>
            </thead>
            <tbody>
                <tr><td>row1 col1</td><td>row1 col2</td></tr>
                <tr><td>row2 col1</td><td>row2 col2</td></tr>
            </tbody>
        </table>
    

    CSS:

        table{
            height:2000px;
        }
        thead tr {
             position:fixed;
             left:0;
             top:0;
        }
    


    Edit (after comments)

    Markup:

    <div id='wrapper'>
            <table>
                <thead>
                    <tr><th>head1</th><th>head2</th></tr>
                </thead>
                <tbody>
                    <tr><td>row1 col1</td><td>row1 col2</td></tr>
                    <tr><td>row2 col1</td><td>row2 col2</td></tr>
                </tbody>
            </table>
        </div>
    

    CSS:

    #wrapper{
            height:500;
            overflow:scroll;
            width:400px;
            margin:0 auto;
            background:Gray; 
        }
        table{
            height:2000px; 
        }
        thead tr {
            position:fixed; 
            top:0;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class which is going to need to use the strategy design
need a quick help here. I have a series of hyperlinks all with the
As part of my integration strategy, I have a few SQL scripts that run
I need to develop a strategy pattern where i have a main class with
I have a 'strategy' question. Thing is, we have a table of customers' addresses
I need to create a strategy pattern where a user selects four strategies from
I need to execute strategy.AllTablesUpdated(); for 50 strategies in 2 ms (and I need
I need to develop image zoom-in functionality with JavaScript and HTML5. Which strategy will
This is more like a strategy question: I need to check regularly a long
Need some help, please. I have a line of horizontal thumbnails loaded as ONE

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.