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
1998Orangefaffda5e
1974Marooncdc87a88
2002Maroon9a7f5240
2006Blue6085a365
Total:$95,042.00
BMW
1970Green0d567244
2000Maroonf0013745
1968Orangebf743e83
Total:$10,404.00
Fiat
1999Blackf4fb2884
1996Brown4a82ac02
1969Blue4d09a734
2000Black8f14f2c6
1970Brown4792a4a6
1964Bluef146bfe3
1991Rede8f1a984
1986Redfd8428c8
1975Silver6b3f3efe
1992Redaa393d4a
Total:$54,500.00
Ford
1983Maroonb3397191
1981White33e59d07
1978Orange5a4733bd
1965Yellowadc0c45a
2008Redbed6c71d
2002Orange01e9621e
Total:$74,740.00
Honda
1981Bluea461ceee
1973Orange05cac1a6
2001Blue68f36c21
2006Green4ae66b37
Total:$95,042.00
Jaguar
1975Blue07445cf9
1978Bluef2f0b4db
1966Greendf4930d6
1963Whitea01bab7b
1960Black7a00c1c8
1963Black0c4366de
Total:$16,032.00
Mercedes
1973Silver6255c096
1982Orange522dfb2a
1999Blue1eedf26b
Total:$96,262.00
Renault
1974White5e774b01
1960Maroonb7ff07a4
1978Silver10a667ca
Total:$64,761.00
Volkswagen
1981Maroon8b8db50f
1984Yellow35a5e803
Total:$34,273.00
Volvo
1971Red2de7f5fd
1998Redcc805dea
2006Blue84e14d71
1994Silver543f1c84
1995Silverbbb7b881
1993White6c7a3de5
1962Maroonbf12cb5e
2009Silverb80085e2
2002Maroonc6ef2557
Total:$54,848.00

Rowspan

BrandYearColorId
Audi1998Orangefaffda5e
Audi1974Marooncdc87a88
Audi2002Maroon9a7f5240
Audi2006Blue6085a365
BMW1970Green0d567244
BMW2000Maroonf0013745
BMW1968Orangebf743e83
Fiat1999Blackf4fb2884
Fiat1996Brown4a82ac02
Fiat1969Blue4d09a734
Fiat2000Black8f14f2c6
Fiat1970Brown4792a4a6
Fiat1964Bluef146bfe3
Fiat1991Rede8f1a984
Fiat1986Redfd8428c8
Fiat1975Silver6b3f3efe
Fiat1992Redaa393d4a
Ford1983Maroonb3397191
Ford1981White33e59d07
Ford1978Orange5a4733bd
Ford1965Yellowadc0c45a
Ford2008Redbed6c71d
Ford2002Orange01e9621e
Honda1981Bluea461ceee
Honda1973Orange05cac1a6
Honda2001Blue68f36c21
Honda2006Green4ae66b37
Jaguar1975Blue07445cf9
Jaguar1978Bluef2f0b4db
Jaguar1966Greendf4930d6
Jaguar1963Whitea01bab7b
Jaguar1960Black7a00c1c8
Jaguar1963Black0c4366de
Mercedes1973Silver6255c096
Mercedes1982Orange522dfb2a
Mercedes1999Blue1eedf26b
Renault1974White5e774b01
Renault1960Maroonb7ff07a4
Renault1978Silver10a667ca
Volkswagen1981Maroon8b8db50f
Volkswagen1984Yellow35a5e803
Volvo1971Red2de7f5fd
Volvo1998Redcc805dea
Volvo2006Blue84e14d71
Volvo1994Silver543f1c84
Volvo1995Silverbbb7b881
Volvo1993White6c7a3de5
Volvo1962Maroonbf12cb5e
Volvo2009Silverb80085e2
Volvo2002Maroonc6ef2557
<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>