Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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.…

930 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

10 Experts available now in Live!

Get 1:1 Help Now