我使用素面 5.2 创建数据表,并使用 FrozenHaeader 和 scrollableHeader。
我从
问题
FrozenHaeader 和 scrollableHeader 之间的标题列高度不同步如下图片: 数据表冻结列图片
我的代码
<p:dataTable var="result" value="#{reportBRBean.listZone2}" id="dataTb" selectionMode="single" selection="#{reportBRBean.selectedZone}"
frozenColumns="3" scrollable="true" scrollWidth="800"
rowIndexVar="rowIndex" rowStyleClass="#{(rowIndex mod 2) eq 0 ? 'even' : 'odd'}" rowKey="#{result.zoneCode}" >
冻结头:
<p:columnGroup type="frozenHeader" >
<p:row>
<p:column rowspan="4" width="20" style="background-color: #00CCCC !important;"/>
<p:column rowspan="4" headerText="#{msg['br1.zone.lb.zone']}" width="140" style="background-color: #00CCCC !important;"/>
<p:column rowspan="4" headerText="#{msg['br2.lb.amount.birth.certificate']}" width="110" style="background-color: #00CCCC !important;"/>
</p:row></p:columnGroup>
可滚动标题:
<p:columnGroup type="scrollableHeader" >
<p:row>
<p:column colspan="10" headerText="#{msg['br2.lb.amount.inform.birth']}" width="900" style="background-color: #00CCCC !important;"/>
<p:column rowspan="4" headerText="#{msg['br2.lb.percent.inform.birth.all']}" width="100" style="background-color: #ffcc66 !important;"/>
<p:column colspan="10" headerText="#{msg['br2.lb.amount.noinform.birth']}" width="900" style="background-color: #00CCCC !important;"/>
<p:column rowspan="4" headerText="#{msg['br2.lb.percent.noinform.birth.all']}" width="100" style="background-color: #ffcc66 !important;"/>
</p:row>
<p:row>
<p:column colspan="4" headerText="#{msg['br2.lb.amount.inform.within15']}" style="background-color: #ff99ff !important;"/>
<p:column rowspan="3" headerText="#{msg['br2.lb.percent.inform.within15']}" style="background-color: #ffff99 !important;"/>
<p:column colspan="4" headerText="#{msg['br2.lb.amount.inform.over15']}" style="background-color: #ff99ff !important;"/>
<p:column rowspan="4" headerText="#{msg['br2.lb.percent.inform.over15']}" style="background-color: #ffff99 !important;"/>
<p:column colspan="4" headerText="#{msg['br2.lb.amount.noinform.within15']}" style="background-color: #ff99ff !important;"/>
<p:column rowspan="3" headerText="#{msg['br2.lb.percent.noinform.within15']}" style="background-color: #ffff99 !important;"/>
<p:column colspan="4" headerText="#{msg['br2.lb.amount.noinform.over15']}" style="background-color: #ff99ff !important;"/>
<p:column rowspan="4" headerText="#{msg['br2.lb.percent.noinform.over15']}" style="background-color: #ffff99 !important;"/>
</p:row>
谢谢