您可能可以使用表格标题、panelGrid 和一点 CSS 来实现您想要的。
<style type="text/css">
.colstyle {
width: 25%
}
</style>
</head>
<body>
<f:view>
<h:dataTable border="1" value="#{columnsBean.rows}" var="row"
columnClasses="colstyle">
<f:facet name="header">
<h:panelGrid columns="2" border="1" style="width: 100%">
<h:outputLabel style="width: 100%" value="MAIN HEADER FOR COL1+2" />
<h:outputLabel style="width: 100%" value="MAIN HEADER FOR COL3+4" />
</h:panelGrid>
</f:facet>
<h:column>
<f:facet name="header">
<h:outputText value="COL1 Header" />
</f:facet>
<h:outputLabel value="#{row.col1}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="COL2 Header" />
</f:facet>
<h:outputLabel value="#{row.col2}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="COL3 Header" />
</f:facet>
<h:outputLabel value="#{row.col3}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="COL4 Header" />
</f:facet>
<h:outputLabel value="#{row.col4}" />
</h:column>
</h:dataTable>
</f:view>