aspose file tools*
The moose likes JSF and the fly likes Fixed Header on Tables? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Fixed Header on Tables?" Watch "Fixed Header on Tables?" New topic
Author

Fixed Header on Tables?

Josh Juneau
Ranch Hand

Joined: Jun 16, 2004
Posts: 86
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


Database Administrator/Application Developer
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
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 ]

- Varun
Josh Juneau
Ranch Hand

Joined: Jun 16, 2004
Posts: 86
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

Joined: May 30, 2002
Posts: 1400
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

Joined: Jun 16, 2004
Posts: 86
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Search the HTML and JavaScript forum....

Eric
Eugene Lucash
Ranch Hand

Joined: Feb 19, 2005
Posts: 77
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

Joined: Jun 16, 2004
Posts: 86
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Fixed Header on Tables?