File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » JSF
Bookmark "Adding a caption to h:dataTable" Watch "Adding a caption to h:dataTable" New topic

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 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="" target="_blank" rel="nofollow"></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>?
I agree. Here's the link:
subject: Adding a caption to h:dataTable
It's not a secret anymore!