p:database width

UI Components for JSF
Post Reply
User avatar
silverfox
Posts: 8
Joined: 23 Jun 2010, 10:18

30 Jun 2010, 17:33

Hello,

I'm using primefaces-1.1.RC1-SNAPSHOT.jar (29/06/2010)

I have a p:datatable with the attribute "width" 100%, but the table is shown like this:
Image

If I add this to my CSS file:

Code: Select all

.ui-widget-content{
	width: 100%;
}
I have the same table like this:
Image

but this style affect more elements than p:datatable, so this is not a solution.

Is there any problem with the "width" property for p:datatable or am I doing something wrong?

Thanks
apache-tomcat-6.0.16, JSF mojarra 1.2_14, primefaces-1.1.RC1-SNAPSHOT

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

30 Jun 2010, 17:46

Hi,

Yes. Try

Code: Select all

#myTableId .yui-dt table {
	width: 100%;
}
where myTableId is the ID of you data table.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
silverfox
Posts: 8
Joined: 23 Jun 2010, 10:18

30 Jun 2010, 18:08

Hello again,

Thanks, Oleg. Your solution is not working because you are using the style names of yahoo, but now this name has changed in order to use themeroller themes, but your idea is a good solution:

p:datatable has to be inside a form:

Code: Select all

<h:form id="tableItemsForm">
	<p:dataTable dynamic="true" id="areaTable" var="area"
...
...
...
The style in my CSS is:

Code: Select all

#tableItemsForm .ui-widget-content {
	width: 100%;
}
If you use #areaTable instead #tableItemsForm in the CSS it doesn't work.

Anyway, I think that the "width" attribute for p:datatable is not working...
apache-tomcat-6.0.16, JSF mojarra 1.2_14, primefaces-1.1.RC1-SNAPSHOT

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests