Solved

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

Posted on 2006-11-03
4
3,665 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

778 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