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
1974Orangec27102d2
1989Blackb666fee4
1993Blackbc5bd9c7
1987White0c75e7b1
Total:$27,044.00
BMW
1976Blue78b05a72
2000Red7b956f2d
1967Green8322e4b3
1965Blue17976835
Total:$52,917.00
Fiat
2001Whiteda83d01f
2001Orangef964d99d
1966Blue3ad94cbf
1998Blacke5d8705a
1992Orangea4efe866
Total:$24,020.00
Ford
1976Marooncbbbcbf3
1976Black913b8c93
1996Red9792f1bb
1972White9aaaba60
Total:$22,634.00
Honda
1989Yellow95e94838
2001Brown0625dc63
1963Orange29482c4a
2007Greenf935d104
1970Silvere633630a
1997Black0d4ef120
1969Orange5212c40c
1961Yellowd41de75c
2002Green14007ff7
Total:$65,465.00
Jaguar
2007Silver5036a214
1989Yellow138a03d9
1988Silverb5af2b28
1972Orange42d384e5
1961Maroon30af550f
Total:$1,533.00
Mercedes
1975Brown4bed76b4
1970Orangef15a244e
1966Brownf5f1e030
Total:$49,829.00
Renault
2007Silver3abf997f
1972Bluef505c9ad
1984Black2a8f5b67
1964Silvere011d105
1969Brown2dc1193c
Total:$90,116.00
Volkswagen
1979Black7eaab36d
1970Silver12b2e447
1965Maroonae135517
1970Orange91914dfa
Total:$76,229.00
Volvo
1999Maroon8eef6eec
1987Orangef1e896ac
1962Bluee8ff270c
1997Silver3bc55a4b
1968Redd32056dc
1989Blue9360b0e7
1964Silvere8cd7f9a
Total:$35,878.00

Rowspan

BrandYearColorId
Audi1974Orangec27102d2
Audi1989Blackb666fee4
Audi1993Blackbc5bd9c7
Audi1987White0c75e7b1
BMW1976Blue78b05a72
BMW2000Red7b956f2d
BMW1967Green8322e4b3
BMW1965Blue17976835
Fiat2001Whiteda83d01f
Fiat2001Orangef964d99d
Fiat1966Blue3ad94cbf
Fiat1998Blacke5d8705a
Fiat1992Orangea4efe866
Ford1976Marooncbbbcbf3
Ford1976Black913b8c93
Ford1996Red9792f1bb
Ford1972White9aaaba60
Honda1989Yellow95e94838
Honda2001Brown0625dc63
Honda1963Orange29482c4a
Honda2007Greenf935d104
Honda1970Silvere633630a
Honda1997Black0d4ef120
Honda1969Orange5212c40c
Honda1961Yellowd41de75c
Honda2002Green14007ff7
Jaguar2007Silver5036a214
Jaguar1989Yellow138a03d9
Jaguar1988Silverb5af2b28
Jaguar1972Orange42d384e5
Jaguar1961Maroon30af550f
Mercedes1975Brown4bed76b4
Mercedes1970Orangef15a244e
Mercedes1966Brownf5f1e030
Renault2007Silver3abf997f
Renault1972Bluef505c9ad
Renault1984Black2a8f5b67
Renault1964Silvere011d105
Renault1969Brown2dc1193c
Volkswagen1979Black7eaab36d
Volkswagen1970Silver12b2e447
Volkswagen1965Maroonae135517
Volkswagen1970Orange91914dfa
Volvo1999Maroon8eef6eec
Volvo1987Orangef1e896ac
Volvo1962Bluee8ff270c
Volvo1997Silver3bc55a4b
Volvo1968Redd32056dc
Volvo1989Blue9360b0e7
Volvo1964Silvere8cd7f9a
<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>