Forums Register Login
dataTable in JSF
Hi all,
I am new to JSF .In my application I am using <h:dataTable> to populate a dynamic table .I have two columns "NUMBER" and "NAME".I am using the following Code ---
<h:dataTable id="dt1" value="#synergyCustomerManagementBeanHandle.result}" var="item" border="1" cellpadding="0" cellspacing="0" width="100%" bgcolor="white" >
<h:column >
<f:facet name="header" >
<hutputText value="Number" />
<hutputText value="#{item.number}"></hutputText>
<f:facet name="header">
<hutputText value="Name" />
<hutputText value="#{item.name}"></hutputText>

NOw The problem is both the column taking the same space .but i want that the size of the two column will be 20%(NUMBER) and 80%(NAME). but how to do that because
<h:column>,<f:facet> nothing cotains property like width .

How can I do this kind of alignment?
Thanks in Advance.

you can use the "columnClasses" attribute of the h:dataTable Tag.
You can specify for every column one style-class.


You can specify styles for the rows as well with the "rowClasses"-Attribute

See more Examples with JSF-Datatables on http://www.j4fry.org/J4Fry_Quick_Setup_Tomcat_MyFaces_Hibernate/index.faces

Visit http://www.j4fry.org
"Alexander Bell",
Please check your private messages regarding an important administrative matter.
DataTable in JSF
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 2893 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 21, 2018 11:15:20.