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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:45:57+00:00 2026-05-27T18:45:57+00:00

I would like to create a table with scrollable data. I have to freeze

  • 0

I would like to create a table with scrollable data. I have to freeze the first row and first column of the table. The first row and first column of the table must automatically resize in width and height to the variable cell dimensions in the content area of the table (because the user will be adding new table cells with variable amount of content).

Someone asked a related question:
How can I lock the first row and first column of a table when scrolling, possibly using JavaScript and CSS?

But the link to online demo and source code is dead, so I am unable to confirm the solution.

  • 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-27T18:45:58+00:00Added an answer on May 27, 2026 at 6:45 pm

    Ok, I read a lot of answers on the web and finally assembled a demo that worked. I’m using PHP to create 50 rows in the table, but you can just as easily hard code the data. I essentially created four quadrants (div.q1, div.q2, div.q3 and div.q4), where the fourth quadrant contains the actual data table. I used jquery to copy the table in the fourth quadrant into the second and third quadrant before synchronizing their scroll bars. I used a combination of CSS overflow, width, height and display properties to hide unnecessary TD elements in each of the quadrants. Here’s a full working example:

    <html>
    <head>
    <style>
    body {width:350px;}
    .q1, .q2, .q3, .q4 {overflow:hidden; display:block; float:left;}
    .q1 {width:50px; height: 30px;}
    .q2 {width:300px; height: 30px;}
    .q3 {width:50px; height: 100px;}
    .q4 {width:300px; height: 100px; overflow:auto;}
    
    .q2 .firstCol, .q3 thead, .q4 thead, .q4 .firstCol {display:none;}
    .q2 td {background-color:#999;}
    .q3 td {background-color:#999;}
    .container {width:9999px;}
    
    </style>
    
    <script src="http://code.jquery.com/jquery-1.7.min.js"></script>
    <script>
    $(document).ready(function(){
       $('.q4').bind('scroll', fnscroll);
       $('.q2').html($('.q4').html());
       $('.q3').html($('.q4').html());
    });
    
    function fnscroll(){
    
    $('.q2').scrollLeft($('.q4').scrollLeft());
    $('.q3').scrollTop($('.q4').scrollTop());
    
    
    }
    
    </script>
    </head>
    
    
    <body>
             <div class="q1"><div class="container"></div></div>
             <div class="q2"><div class="container"></div></div>
             <div class="q3"><div class="container"></div></div>
             <div class="q4">
                <div class="container">
                <table>
                   <thead>
                      <tr>
                         <td class="firstCol"></td>
                         <td>Col</td>
                         <td>Col</td>
                         <td>Col</td>
                         <td>Col</td>
                         <td>Col</td>
                         <td>Col</td>
                         <td>Col</td>
                         <td>Col</td>
                      </tr>
                   </thead>
                   <tbody>
                   <?php for($c=0; $c<50; $c++) { ?>
                      <tr>
                         <td class="firstCol">Row</td>
                         <td>this is some content</td>
                         <td>hello world!<br/>This is good</td>
                         <td>Row</td>
                         <td>adjfljaf oj eoaifj </td>
                         <td>ajsdlfja oije</td>
                         <td>alsdfjaoj f</td>
                         <td>jadfioj</td>
                         <td>jalsdjf oai</td>
                      </tr>
                   <?php } ?>
                   </tbody>
                </table>
                </div>
             </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a table with a scrollable body. I'll have my
I would like to create an HTML table with row colors changing based on
I have a table with data that looks like this: create table demo_patient_info (
I would like to create a table which has column like title,target and I
I would like to create a table that has both a column for created
I have a table of dictionary terms and now I would like to create
I would like to create a table to store device settings. The table has
I have created a test table in MySQL and would like to insert 10
i have a table in access and i would like to get the SQL
I have a table that looks something like this: CREATE TABLE student_results(id integer, name

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.