Solved

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…

760 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

18 Experts available now in Live!

Get 1:1 Help Now