Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 755
  • Last Modified:

Lock Header and First Column in HTML table (JSP)

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
germess
Asked:
germess
  • 2
1 Solution
 
arataniCommented:
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
 
arataniCommented:
Hey gerness, you should type your response in here,

AJ
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now