Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fixed Header on Tables?

 
Josh Juneau
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project right now which needs to have a fixed header for a datatable. I would like for it to work like Excel whereas you can have a header which scrolls with you as you move down the page. Is this possible using either the standard JSF datatable or the Oracle ADF table?


Thanks for you assistance!

Josh
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about using 2 datatables - one for table headings and one for table body.

Let me know if you find another approach.
[ February 18, 2005: Message edited by: K Varun ]
 
Josh Juneau
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I've tried the two table method, however, the table cell sizes may fluctuate which causes problems (obviously) because the header will not match up with the content. I may try to use frames, but I really do not want to get into that because it just gets too messy.

Thanks anyways...
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Josh Juneau:
Yeah, I've tried the two table method, however, the table cell sizes may fluctuate which causes problems (obviously) because the header will not match up with the content.


Not an issue, you can fix this problem. Use same "width" attribute in style for corresponding elements and life would be easier.
 
Josh Juneau
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True, I guess I could just set the width to the largest width which is needed. That could do the trick. Let me work with this a bit and I will let you know my results.

Thanks for your help-

Josh
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search the HTML and JavaScript forum....

Eric
 
Eugene Lucash
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.First Solution.
Many browsers but not all (i don't remember, perhaps two of IE, OP, MZ)
support something like this

2.Second solution
Mаке two tables, header and with data, which in some implementation of ScrollPane using html+css
and set fixed width columns (using css classes)
[ February 19, 2005: Message edited by: Eugene Lucash ]
 
Josh Juneau
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all of the assistance. At this point, I have the two-header implementation working. I think I am going to check out solution #1 above and see if that buys me a different way of achieving these results.

Thanks-

Josh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic