DataTable - Row Grouping - since v6.0.11

Rows can be grouped in two ways, using rowGroup component or with groupRow attribute on a column.

Header Row

YearColorId
Audi
1981Blackc7dbb438
Total:$11,095.00
BMW
1983Orange7fb10d7b
1996Brown1b2e9593
1971Silver31f89ff1
1961Brown282abaee
1983Silver0659bc3b
1992Blue440d01f0
2001Brown7e4dc6c7
1966Maroond907920a
Total:$30,158.00
Fiat
1985Silver19d35d90
1969Green86dd41c9
1997Red82186832
2009Bluee539ba12
2001Red53ee88fd
1961Brown4dd4c2fa
1990Silverd5c32650
2000Blacke0bc20c6
Total:$59,267.00
Ford
2000Whitee635af5b
2002Green332652c6
2002Blackc8e32713
1967White8d913e5e
1981Green76b91559
1988Brown95e5cbb7
1972Yellow80456c5e
Total:$56,369.00
Honda
1997Orange78729947
1984Greenc88e57d0
1999Orangec4b171bf
1986Whited997c232
Total:$12,741.00
Jaguar
1981Silver83f9df62
1970Yellowedd6c3b9
1996Orange87fc15fb
2001Bluea41be153
1971Yellow28af255d
1998Rede93a0be3
Total:$87,672.00
Mercedes
1965Maroonfaeff7de
1994Yellowb8b77253
1976Red731c9e01
1988Orange8d4c4e0e
1978Silver67b6b067
Total:$42,101.00
Renault
1970Blackd47a6600
1987Whitece389216
2004Yellow9100b8a0
Total:$37,363.00
Volkswagen
2008Silverfb92d590
1965Maroonb47dd180
1971Blue23d53711
1985Brown6a62299e
1985Red63e7cb3c
1987Whitebd303763
Total:$80,330.00
Volvo
1975Orangee1f21d00
1960Whitecb8f5f8c
Total:$40,353.00

Rowspan

BrandYearColorId
Audi1981Blackc7dbb438
BMW1983Orange7fb10d7b
BMW1996Brown1b2e9593
BMW1971Silver31f89ff1
BMW1961Brown282abaee
BMW1983Silver0659bc3b
BMW1992Blue440d01f0
BMW2001Brown7e4dc6c7
BMW1966Maroond907920a
Fiat1985Silver19d35d90
Fiat1969Green86dd41c9
Fiat1997Red82186832
Fiat2009Bluee539ba12
Fiat2001Red53ee88fd
Fiat1961Brown4dd4c2fa
Fiat1990Silverd5c32650
Fiat2000Blacke0bc20c6
Ford2000Whitee635af5b
Ford2002Green332652c6
Ford2002Blackc8e32713
Ford1967White8d913e5e
Ford1981Green76b91559
Ford1988Brown95e5cbb7
Ford1972Yellow80456c5e
Honda1997Orange78729947
Honda1984Greenc88e57d0
Honda1999Orangec4b171bf
Honda1986Whited997c232
Jaguar1981Silver83f9df62
Jaguar1970Yellowedd6c3b9
Jaguar1996Orange87fc15fb
Jaguar2001Bluea41be153
Jaguar1971Yellow28af255d
Jaguar1998Rede93a0be3
Mercedes1965Maroonfaeff7de
Mercedes1994Yellowb8b77253
Mercedes1976Red731c9e01
Mercedes1988Orange8d4c4e0e
Mercedes1978Silver67b6b067
Renault1970Blackd47a6600
Renault1987Whitece389216
Renault2004Yellow9100b8a0
Volkswagen2008Silverfb92d590
Volkswagen1965Maroonb47dd180
Volkswagen1971Blue23d53711
Volkswagen1985Brown6a62299e
Volkswagen1985Red63e7cb3c
Volkswagen1987Whitebd303763
Volvo1975Orangee1f21d00
Volvo1960Whitecb8f5f8c
<h3 class="first">Header Row</h3>
<h:form>
    <p:dataTable var="car" value="#{dtRowGroupView.cars}" sortBy="#{car.brand}" expandableRowGroups="true">
        <p:headerRow>
            <p:column colspan="3">
                <h:outputText value="#{car.brand}" />
            </p:column>
        </p:headerRow>
        <p:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </p:column>
        <p:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </p:column>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </p:column>
        <p:summaryRow>
            <p:column colspan="2" style="text-align:right">
                <h:outputText value="Total:" />
            </p:column>
            <p:column>
                <h:outputText value="#{dtRowGroupView.randomPrice}">
                    <f:convertNumber type="currency" currencySymbol="$" />
                </h:outputText>
            </p:column>
        </p:summaryRow>
    </p:dataTable>
</h:form>

<h3>Rowspan</h3>
<h:form>
    <p:dataTable var="car" value="#{dtRowGroupView.cars}" sortBy="#{car.brand}">
        <p:column headerText="Brand" groupRow="true">
            <h:outputText value="#{car.brand}" />
        </p:column>
        <p:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </p:column>
        <p:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </p:column>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </p:column>
    </p:dataTable>
</h:form>