Thursday, 19 September 2013

how to create a vertical datatable

how to create a vertical datatable

Í´ve got a regular datatable in primefaces, but I want it to display data
in a vertical way. When you create a datatable; you get something like:
id user 1 aa 2 bb
But I need to show it like this:
id 1 2 user a bb
This is the code of a regular table:
<h:form>
<p:dataTable var="car" value="#{tableBean.carsSmall}">
<p:column headerText="Model">
<h:outputText value="#{car.model}" />
</p:column>
<p:column headerText="Year">
<h:outputText value="#{car.year}" />
</p:column>
<p:column headerText="Manufacturer">
<h:outputText value="#{car.manufacturer}" />
</p:column>
<p:column headerText="Color">
<h:outputText value="#{car.color}" />
</p:column>
</p:dataTable>
</h:form>
What do I need to change in the code so I can have a vertical table.
Thanks in advance.

No comments:

Post a Comment