I am using primefaces datatable. How to set width when the table is empty ? because in this case the table smaller when they have some record, I try use style
style="width: 150%"
or
style="width: 200px"
but with no success.
And it is possible to change default text "No records found." to something else ?
<p:dataTable style="width:25px;">
will change the width of the table, but the column headers and the message displayed when there are no records also effects the width of the table.
Check the text in your column headers. The text will not line break between words, so the column will have a minium width based on the header text.
<p:column>
<f:facet name="header">
<h:outputText value="This is a long column header" />
</f:facet>
<h:outputText value="#{bean.value}" />
</p:column>
The No Records Found
message will line break between words
so it will only effect the width if one of the words in the message is to long.
<p:dataTable style="width:25px;" emptyMessage="thisisalongmessagefornodata">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With