• Post Reply Bookmark Topic Watch Topic
  • New Topic

h:panelGrid and thead rows

 
veli akcakaya
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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">
<hutputText 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.
 
Thiebaut olivier
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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">
<hutputText value="Thead1"/>
</facet>
<hutputText value="row1">
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Thead2"/>
</facet>
<hutputText 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
  • Quote
  • Report post to moderator
Hi Olivier,

i try your suggestion. my code is;

<h:panelGrid columns="2">
<h:column>
<f:facet name="header">
<hutputText value="Thead1"/>
</f:facet>
<hutputText value="row1" />
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Thead2"/>
</f:facet>
<hutputText 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,
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!