---
title: Row grouping
description: "Row grouping is a premium feature which allows plugin users to group row data. ## Inline demo server-side row grouping | Product line | Product ID | Product name | Vendor | Stock | Price | Retail price | Description…"
url: "https://docs.legacy.wpdataaccess.com/docs/row-grouping/"
updated: "2025-11-19"
category: Legacy Tools / Tables / Advanced Features
---

# Row grouping

Row grouping is a premium feature which allows plugin users to group row data.

## Inline demo server-side row grouping

| Product line | Product ID | Product name | Vendor | Stock | Price | Retail price | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Product line | Product ID | Product name | Vendor | Stock | Price | Retail price | Description |

## Enable row grouping

With WP Data Access premium installed option **rowGroup** is available from advanced table options which adds row grouping to a data table. [Additional row grouping options...](https://datatables.net/extensions/rowgroup/examples/initialisation/startAndEndRender.html)

  The endRender function of the example above calls javascript function code_manager_row_grouping_demo. This function needs to be added to the page using a plugin like the [Code Manager](https://code-manager.com/blog/docs/index/shortcodes/javascript-shortcodes/).[https://wpdataaccess.com/pricing/](https://wpdataaccess.com/pricing/)

Advanced options to add row grouping

```
{
	"rowGroup": {
		"dataSrc": 0,
		"endRender": "function ( rows, group ) { return code_manager_row_grouping_demo(rows, group) }"
	}
}
```

Advanced options to add row grouping

```
function code_manager_row_grouping_demo(rows, group) {
	var avgInStock = rows.data().pluck(4).reduce( function (a, b) { return parseFloat(a) + parseFloat(b); } ) / rows.count();

	var avgPrice = rows.data().pluck(5).reduce( function (a, b) { return parseFloat(a) + parseFloat(b); } ) / rows.count();
	avgPrice = jQuery.fn.dataTable.render.number('.', ',', 2, '$').display( avgPrice );

	var avgRetailPrice = rows.data().pluck(6).reduce( function (a, b) { return parseFloat(a) + parseFloat(b); } ) / rows.count();
	avgRetailPrice = jQuery.fn.dataTable.render.number('.', ',', 2, '$').display( avgRetailPrice );

	//return "Average for " + group + ": " + Math.floor(avgInStock) + " : " + avgPrice + " : " + avgRetailPrice;
	return jQuery('<tr/>')
		.append('<td colspan="4">Averages for '+group+'</td>' )
		.append('<td class="quantityInStock">'+Math.floor(avgInStock)+'</td>')
		.append('<td class="buyPrice">'+avgPrice+'</td>')
		.append('<td class="MSRP">'+avgRetailPrice+'</td>');
}
```

## Limitations

- Column ordering cannot be changed interactively with server-side processing (only supported with client-side processing)
- Nested grouping is not supported
- Grouping information is not exported (PDF, CSV, etc)[https://wpdataaccess.com/pricing/](https://wpdataaccess.com/pricing/)

## Inline demo client-side row grouping

| Product line | Product ID | Product name | Vendor | Stock | Price | Retail price | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Product line | Product ID | Product name | Vendor | Stock | Price | Retail price | Description |
