Hi,
I need <p:dataTable /> without header. What is the easy way to do this ?
thank you
datatable without header
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Which header? the column header of Datatable ??
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Please try with;
For only one datatable;
For all Datatable;
For only one datatable;
Code: Select all
.noHeader.ui-datatable table thead tr {
display: none;
}
<p:dataTable styleClass="noHeader" ..>
Code: Select all
.ui-datatable table thead tr {
display: none;
}
Github Profile: https://github.com/mertsincan
-
- Posts: 122
- Joined: 13 Dec 2011, 15:07
Hi,
I created new css file and put the above code , but it worked . No changes.
I created new css file and put the above code , but it worked . No changes.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
I tested this issue with my css code. it works fine. Please check your style on firebug of the browser.
My test code (in datatable.xhtml);
My css code(test.css);
My Screenshot;
My test code (in datatable.xhtml);
Code: Select all
<p:dataTable styleClass="noHeader" id="singleDT" var="car" value="#{dtSelectionView.cars7}" selectionMode="single" selection="#{dtSelectionView.selectedCar}" rowKey="#{car.id}"
rows="10" paginator="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15" emptyMessage="No cars found with given criteria" reflow="true">
<p:column headerText="Id" sortBy="#{car.id}">
<h:outputText value="#{car.id}" />
</p:column>
<p:column headerText="Year" sortBy="#{car.year}">
<h:outputText value="#{car.year}" />
</p:column>
<p:column headerText="Brand" sortBy="#{car.brand}">
<h:outputText value="#{car.brand}" />
</p:column>
<p:column headerText="Color" sortBy="#{car.color}">
<h:outputText value="#{car.color}" />
</p:column>
</p:dataTable>
Code: Select all
.noHeader.ui-datatable table thead tr {
display: none;
}
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Glad to hear, thanks !
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests