tags:

views:

35

answers:

2

I need to print only the contents of a h:datatable. How can I do this?

+1  A: 

A somewhat simpler example, without the caption bug ;-)

<h:dataTable value="#{MyBean.myCollection}" var="item">
<h:column>
             <h:outputText value="#{item}"></h:outputText>
</h:column>
</h:dataTable>
EJP
+1  A: 

Use CSS media rules to hide all other content from printing.

E.g.

 @media print {
     #header, #footer, #menu { display: none; }
 }

You can also put it in its own stylesheet file and reference it using

<link rel="stylesheet" href="print.css" media="print" />
BalusC