Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

Stars 1,023
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.45.0
Language: PowerShell Updated: 2026-11-03
Command

New-TableRowGrouping

Module
PSWriteHTML

Creates a new table row grouping object with specified attributes.

Syntax

New-TableRowGrouping
[[-BackgroundColor] <String>]
[[-Color] <String>]
[[-ColumnID] <Int32>]
[[-Name] <String>]
[[-SortOrder] <Ascending|Descending>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function creates a new table row grouping object with the provided attributes. It enables the feature for DataTablesRowGrouping in the HTML schema.

Examples

Example 1

New-TableRowGrouping -Name "Group A" -ColumnID 1 -SortOrder 'Ascending' -Color 'Red' -BackgroundColor 'LightGray'
Creates a new table row grouping object for Group A, grouping by column ID 1 in ascending order with red text and light gray background.

Example 2

New-TableRowGrouping -Name "Group B" -ColumnID 2 -SortOrder 'Descending' -Color 'Blue' -BackgroundColor 'White'
Creates a new table row grouping object for Group B, grouping by column ID 2 in descending order with blue text and white background.

Parameters

-BackgroundColor String optionalposition: 4
Specifies the background color for the row grouping.
-Color String optionalposition: 3
Specifies the color for the row grouping.
-ColumnID Int32 optionalposition: 1
Specifies the ID of the column to group rows by. Default value is -1.
-Name String optionalposition: 0aliases: ColumnName
Specifies the name of the row grouping.
-SortOrder String optionalposition: 2
Specifies the sort order for the grouped rows. Valid values are 'Ascending' or 'Descending'. Default is 'Ascending'.
Possible values: Ascending, Descending

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.