• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

h:panelGrid and thead rows

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i'm trying to make a table including <thead> row via <h:panelGrid. But i couldnt code for thead columns. I tried to use <f:facet, but it not same as my want.

<f:facet name="header">
<h:outputText value="header"/>
</f:facet>


How can i make this table by <h:panelGrid
<table>
<thead>
<tr>
<th align="left">Thead1</th>
<th align="left">Thead2</th>
<th align="right">Thead3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 - Col 1</td>
<td>Row 1 - Col 2</td>
<td align="right">Row 1 - Col 3</td>
</tr>
<tr>
<td>Row 2 - Col 1</td>
<td>Row 2 - Col 2</td>
<td align="right">Row 2 - Col 3</td>
</tr>
</tbody>
</table>

Have a nice day.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

It 's a simple example

you mustuse <h:column> for each column like this.

<h:column>
<f:facet name="header">
<h:outputText value="Thead1"/>
</facet>
<h:outputText value="row1">
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Thead2"/>
</facet>
<h:outputText value="row2">
</h:column>

-Thead1-Thead2
-row1-row2
for a new column ,you add the same example
that's all
olivier
 
veli akcakaya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Olivier,

i try your suggestion. my code is;

<h:panelGrid columns="2">
<h:column>
<f:facet name="header">
<h:outputText value="Thead1"/>
</f:facet>
<h:outputText value="row1" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Thead2"/>
</f:facet>
<h:outputText value="row2" />
</h:column>
</h:panelGrid>

and result of this code ;

<table>
<tbody>
<tr>
<td>row1</td>
<td>row2</td>
</tr>
</tbody>
</table>

it is not include <thead>.

Do you have any else suggestion.

Thanks,
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not possible with h:panelGrid. That's only possible with h:dataTable.

If the amount of cells is known beforehand, you can also just use a plain vanilla HTML table instead.
 
reply
    Bookmark Topic Watch Topic
  • New Topic