Solved

Freezing first row and first column of a table with no performance issues

Posted on 2006-11-03
4
3,673 Views
Last Modified: 2008-01-09
Hi,

I have one JSP page in that rows are arround 200 and column ranges from 4 to 100. when i am freezing first row of my table i have no performance issue even though how many columns get increased but as i am freezing first column of a table page is getting slower
while scrolling right.

This thing i am doing by using styleSheet code which i have pasted below

<style>
 
/* Setting the width and height of table througn DIV tag */
div#tbl-container {
  width:70%;
  height:70%;
 overflow: auto;
}
 
thead th, thead th.locked {
position:relative;
cursor:default;
}
 
/* This block of code will Freeze the header of table */
thead th {
left: expression(document.getElementById("tbl-container").scrollLeft); /* IE5+ only */
}
 
</style>

Since it is very urgent for me. Please suggest me ASAP.

Thanks,
Ashish
0
Comment
Question by:autoknowledge
4 Comments
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 250 total points
ID: 17865672
For browsers other than MSIE5 you might consider using position: fixed;  so that the CSS itself doesn't contain such an expression.  (I'm not familiar with this expression(.scrollLeft) business, but it seems like it requires actively recalculating where the th should begin, and it strikes me that it can't be terribly efficient.
0
 
LVL 30

Assisted Solution

by:VirusMinus
VirusMinus earned 250 total points
ID: 17865908
what sort of data is in the first row and column? position: fixed, or alternative body, html 100% with absolute for MSIE could do what you're after:

see examples here: http://tagsoup.com/cookbook/css/fixed/#gtev6-demos
also: http://www.divinentd.com/experiments/emulating-position-fixed.html
and: http://www.howtocreate.co.uk/fixedPosition.html
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

821 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