Solved

Lock Header and First Column in HTML table (JSP)

Posted on 2004-10-04
2
733 Views
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>
     
      <%
        }
      %>
       </table></div>             
      
      
      <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++)
         {
        %>
         <td>Day</td>
        <%  
         }
            %>  
            </tr>  


      
            <%
             for (int rowData=0;rowData<5;rowData++)
         {            
                  
            %>
            <tr style="height:0">
            <%
               for (int tCodeData=0;tCodeData<10;tCodeData++)
               {            
              
                  %>      
                    <td>HW</td>
                  <%
                  }
            }
            %>  
            <tr>
             </table>
             </div>
             
 
</wb:page>
0
Comment
Question by:germess
  • 2
2 Comments
 
LVL 4

Accepted Solution

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

overflow-y:scroll;

Add that to the div style value.

AJ
0
 
LVL 4

Expert Comment

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

AJ
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now