wood burning stoves 2.0*
The moose likes JSF and the fly likes HTML table to JSF table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "HTML table to JSF table" Watch "HTML table to JSF table" New topic
Author

HTML table to JSF table

lvcsta lvcsta
Greenhorn

Joined: Apr 20, 2009
Posts: 1
Hi all,

Im trying to write the following html table as JSF table,


<table border="1" width="100">
<tr>
<th>
Header1
</th>
<th colspan="3" align="center">
Header2
</th>
</tr>

<tr>
<th>

</th>
<th>
Sub2 Header1
</th>
<th>
Sub2 Header2
</th>
<th>
Sub2 Header3
</th>
</tr>


<tr>
<td>
Header1 Data;
</td>
<td>
Sub2 Header1 Data1;
</td>
<td>
Sub2 Header2 Data1;
</td>
<td>
Sub2 Header3 Data1;
</td>
</tr>

<tr>
<td>
Header1 Data;
</td>
<td>
Sub2 Header1 Data2;
</td>
<td>
Sub2 Header2 Data2;
</td>
<td>
Sub2 Header3 Data2;
</td>
</tr>

</table>



Your help will be appreciated.
Augustine Chelliah
Greenhorn

Joined: Mar 12, 2009
Posts: 28
You could probably use panelGrid if your data is static. If you have dynamic data, use the Datatale.

By the way in your html code, I see that your second row has only 3 columns while the others have 4. I guess you have missed to add colspan attribute there. Let us know the correction and also let me know if I've understood wrong.


Thanks & Regards,
Augustine
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

The key really is whether this is just static data, or whether there is a collection that contains this data that will change in size?

A JSF dataTable is designed to loop through lists or collections of objects. If your data, each row that is, can be organized into a Java object that can be thrown into a list, then you'll get the most effective use from a dataTable.



JSF Toolbox

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML table to JSF table
 
Similar Threads
variables in XSL
best option for implementing form
NN6 equivalent code
CSS : Cell borders showing up on th cells but not td
HTML table uniform row size..