我正在使用 primefaces 数据表和我的代码是这样的
<p:dataTable id="dataTableBonusSplit" var="announcements"
value="#{announcementBean.dataList}" scrollable="true" scrollHeight="550"
paginator="true" rows="10"
paginatorPosition="bottom"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15" sortMode="multiple">
<p:column headerText="Company"
sortBy="#{announcementBean.cName}" style="width:110px;"
styleClass="wrap" for="companyName">
<h:outputText value="#{announcements.companyName}"></h:outputText>
</p:column>
<p:column headerText="Type" style="width:110px;"
styleClass="wrap" sortBy="#{announcements.announcementType}">
<h:outputText value="#{announcements.announcementType}"></h:outputText>
</p:column>
<p:column headerText="Date" style="width:110px;"
styleClass="wrap" sortBy="#{announcements.announcementDt}">
<h:outputText value="#{announcements.announcementDt}">
<f:convertDateTime type="date" pattern="dd/MMM/yyyy" />
</h:outputText>
</p:column>
<p:column headerText="Announcement" style="table-layout: fixed;white-space: normal;"
sortBy="#{announcements.announcement}" >
<h:outputText value="#{announcements.announcement}"></h:outputText>
</p:column>
</p:dataTable>
如果你想让桌子看起来很糟糕,你可以看到图像,任何好的解决方案都可以。