Solved

Lock Header and First Column in HTML table (JSP)

Posted on 2004-10-04
2
738 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

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 …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

820 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