Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Column Freez in HTML table.

 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh,

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

Regards,
Dan
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic