aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Column Freez in HTML table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Column Freez in HTML table." Watch "Column Freez in HTML table." New topic
Author

Column Freez in HTML table.

samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
Hi Ranchers,
I am trying to write a code for a table which is having in all 10 columns . My erquirment is , I need horizontal scroll bar for the table and that too for the columns 4,5,6,7,8.9,10. The columns 1,2,3 should not have that horizontal scroll bar.That is columns 1,2,3 will get freezed.
Can anyone please tell me the way to achive this . Any link ,any white paper will be appriciated.You can get a fair idea about what I am trying to say by looking at the URL "http://home.tampabay.rr.com/bmerkey/examples/locked-column-csv.html"
I have already gone through the code in this link . It works fine with IE but not with mozilla . Can anybody please help me out.

Thanks in advance
Samir



[ August 14, 2007: Message edited by: Bear Bibeault ]
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
Hi samir, i have not tested the code but I see lot of div tags in css there. I think the javascript may vary from broswer to broswer. May be you can try finding what kind of browser it is, and then change the script-code based on that.


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Akhilesh,

Which Javascript are we talking about? It's all CSS

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
hi Dan
Thanks a lot for your prompt reaply . Yes you are right ...its all CSS through which everything is happening. Can you please suggest me the solution for the same so that it can also work in Mozilla
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
Originally posted by Dan Drillich:
Akhilesh,

Which Javascript are we talking about? It's all CSS

Regards,
Dan

I have still not gone through the code, only seen the demo, how do they freeze first column when button is clicked, is it not button click event written in javascript? I believe that is where it all goes to set/reset css attributes & properties.
I believe it is CSS attribute/property names that changes from browser to browser, but most probably we would need script to by-pass mozilla and IE so that the code runs in both.
Correct me if I am wrong.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
The entire solution depends on the CSS line -



I just commented it and nothing works. This line is an IE specific CSS code.

Please look at the following discussion -

http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/72a8da8cad900dea/69f257a6a9429937?lnk=raot


left:
expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
------------------
the LEFT attribute/property of my CSS class is reassigned, and set equal to, the left value of the parent of the parent of the parent of the parent.

Peter said -

My book is about CSS and expressions are not part of the CSS standard, they are only a Microsoft extension.




My first instinct was along the lines of 'put the headers in a separate frame, and make that fixed, and let the rest of it have the natural scrollbars vertically - lock the second frame horizontally for alignment.



Regards,
Dan
[ August 16, 2007: Message edited by: Dan Drillich ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Column Freez in HTML table.