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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:59:19+00:00 2026-05-23T12:59:19+00:00

I have the following table structure: <table> <thead> <tr> <th colspan=4>Current</th> <th colspan=4>New/Requested</th> </tr>

  • 0

I have the following table structure:

<table>   
<thead>   
    <tr>   
        <th colspan="4">Current</th>   
        <th colspan="4">New/Requested</th>   
    </tr>   
    <tr>   
        <th nowrap="nowrap">RSD &nbsp;&nbsp;&nbsp;&nbsp;</th>  
        <th nowrap="nowrap">CRSD &nbsp;&nbsp;&nbsp;&nbsp;</th>   
        <th nowrap="nowrap">MSD &nbsp;&nbsp;&nbsp;&nbsp;</th>   
        <th nowrap="nowrap">Open QTY &nbsp;&nbsp;&nbsp;&nbsp;</th>   
        <th nowrap="nowrap">CRD &nbsp;&nbsp;&nbsp;&nbsp;</th>   
        <th nowrap="nowrap">CRSD &nbsp;&nbsp;&nbsp;&nbsp;</th>  
        <th nowrap="nowrap">MSD &nbsp;&nbsp;&nbsp;&nbsp;</th>   
        <th nowrap="nowrap">Open QTY &nbsp;&nbsp;&nbsp;&nbsp;</th>   
        <th nowrap="nowrap">Action</th>   
        <th nowrap="nowrap">Reason</th>   
        <th nowrap="nowrap">Action Code Status </th>   
    </tr> 
    <tbody>
        <tr>
            <td></td>  
            <td></td>   
            .....plenty of rows
        </tr>
    </tbody>
</thead>   
</table> 

I am trying to fix the header so that if I scroll down it stays visible.
I looked at this post but couldn’t understand it. How can I do this?

  • 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-23T12:59:19+00:00Added an answer on May 23, 2026 at 12:59 pm

    I have written the following code in order to achieve my goal (as asked in question)-

    Here is the plugin i have written.

    (function ($) {
       $.fn.scrollbarTable = function (i) {
           var o = {};
           if (typeof (i) == 'number') o.height = i;
           else if (typeof (i) == 'object') o = i;
           else if (typeof (i) == 'undefined') o = {
               height: 300
           }
           return this.each(function () {
               var $t = $(this);
               var w = $t.width();
               $t.width(w - function (width) {
                   var parent, child;
                   if (width === undefined) {
                       parent = $('<div style="width:50px;height:50px;overflow:auto"><div style="height:50px;"></div></div>').appendTo('body');
                       child = parent.children();
                       width = child.innerWidth() - child.height(99).innerWidth();
                       parent.remove();
                   }
                   return width;
               }());
               var cols = [];
               var tableCols = [];
               $t.find('thead th,thead td').each(function () {
                   cols.push($(this).width());
               });
               $t.find('tr:eq(1) th,thead td').each(function () {
                   tableCols.push($(this).width());
               });
               var $firstRow = $t.clone();
               $firstRow.find('tbody').remove();
               $t.find('thead').remove();
               $t.before($firstRow);
               $firstRow.find('thead th,thead td').each(function (i) {
                   $(this).attr('width', cols[i]);
               });
               $t.find('tr:first th,tr:first td').each(function (i) {
                   $(this).attr('width', tableCols[i]);
               });
               var $wrap = $('<div>');
               $wrap.css({
                   width: w,
                   height: o.height,
                   overflow: 'auto'
               });
               $t.wrap($wrap);
           })
       };
    }(jQuery));
    

    How to use:

    $(document).ready(function(){
        $('table#tabss').scrollbarTable();
    }
    

    hope it will help someone somewhere..

    Any way thanks to all of you for your kind support… 🙂

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

Sidebar

Related Questions

I have a html table with the following structure: <table> <thead> <tr><th>ABC Ltd.</th><tr> </thead>
I have view that contains a table with the following structure: <table id=mappings> <thead>
I have a DOM structure like the following: <table class=playlist> <thead> <tr> <th>TH1</th> <th
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
I have the following table structure (in MySQL): DocID, Code, IsDup, DopOf , where
I have the following table structure. A | B | C I wish to
I have the following table structure, which is imported into an Entity Framework project:
I have the following MySQL table structure: num field company phone website 1 Gas
I have no control over database schema and have the following (simplified) table structure:

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.