*
The moose likes JSF and the fly likes Adding a caption to h:dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Adding a caption to h:dataTable" Watch "Adding a caption to h:dataTable" New topic
Author

Adding a caption to h:dataTable

Wally Hartshorn
Ranch Hand

Joined: Jan 30, 2003
Posts: 77
I'm having trouble finding any information about how to add a <caption> to an <h:dataTable>. There doesn't seem to be anything like <h:caption>, so I tried this:


As you might expect, it dumps out the <caption> just before the <table> begins. Not what I wanted.

Can anyone help?

Thanks in advance!
Wally


Wally Hartshorn
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
You can use facet to put a header for your table.



You can use f:verbatim to enclose large html text
[ February 06, 2006: Message edited by: Eddy Lee Sin Ti ]

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
Wally Hartshorn
Ranch Hand

Joined: Jan 30, 2003
Posts: 77
Unfortunately, that doesn't seem to work. I tried this code:

and got this result:

instead of the desired result:

I tried changing "<f:facet name="caption">", but that's apparently not valid, as the caption doesn't appear at all.

Is there no way to add a <caption> to a <h:dataTable>?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Adding a caption to h:dataTable
 
Similar Threads
Using of nested Datatables
How to handle a list in JSF 2
Submit dataTable fields
Help on JSF Custom tag
Group Validations inside data table