Lock Header and First Column in HTML table (JSP)

Posted on 2004-10-04
Last Modified: 2012-06-22
Hi Experts,
I am trying to implement table which has its header and first column frozen so the user can scroll vertically and horizontally.  I've made my table horizontally scrollable, but how about vertical scrolling. Also, is it possible to show (horizontal) scroll bars at the top and the bottom of the table..
Thanks for your help!!
Below is my sample JSP

<%@ include file="/system/wbheader.jsp"%>
<%@ taglib uri="/WEB-INF/wbsys.tld" prefix="wb"%>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>

<wb:page login='false' domain="VR" fillCurrentLocaleDomainWithDefaults="false" submitMethod='post' submitAction=''>

      <div style="position:absolute;top:60;left:0;width:100">
      <table width="100" frame="border">
      <tr style="height:60"><td>Employee</td></tr>
            for(int headerEmployee=0;headerEmployee<5;headerEmployee++)
      <tr style="height:0"><td>John</td></tr>
      <div STYLE="position:absolute;left:100;top:60;overflow-x:scroll;width:250px">
         <table frame="border">
        <tr style="height:60">
         for (int headerTimeCode=0;headerTimeCode<10;headerTimeCode++)

             for (int rowData=0;rowData<5;rowData++)
            <tr style="height:0">
               for (int tCodeData=0;tCodeData<10;tCodeData++)
Question by:germess
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

aratani earned 250 total points
ID: 12222578
To make it scrollable vertically, I would assume you owuld have to do the following,


Add that to the div style value.


Expert Comment

ID: 12242885
Hey gerness, you should type your response in here,


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question