Evotec

Project

PSWriteHTML

PSWriteHTML is an open-source PowerShell project with packages, release history, and working documentation.

Stars 995
Forks 114
Open issues 69
PowerShell Gallery downloads 7,436,513
Release v1.41.0
Language: PowerShell Updated: 2026-04-11

API Reference

Function

New-TableColumnOption

Aliases: New-HTMLTableColumnOption
Namespace PSWriteHTML
Aliases
New-HTMLTableColumnOption
Inputs
None. You cannot pipe objects to New-TableColumnOption
Outputs
PSCustomObject

Allows for certain modification of options within DataTable's columnDefs parameter. You can set visibility, searchability, sortability, and width for specific columns

Remarks

Allows for certain modification of options within DataTable's columnDefs parameter. See: https://datatables.net/reference/option/columnDefs New-HTMLTable has parameters for -ResponsivePriorityOrder and -ResponsivePriorityOrderIndex and these are set at a higher precedent than options specified here. See the DataTable reference section for conflict resolution. The New-TableColumnOption cmdlet will add entries to the columnDefs parameter in the order in which the cmdlets are ordered. If you use 2 or more New-TableColumnOption, the first cmdlet takes priority over the second cmdlet if they specify the same targets or overriding property values With this in mind, you should almost always specify -AllColumns last, since that will take priority over any commands issued later

Examples

Authored help example

EXAMPLE 1


New-TableColumnOption -ColumnIndex (0..4) -Width 50
The first 5 columns with have a width defined as 50, this may not be exact.
See: https://datatables.net/reference/option/columns.width
        

EXAMPLE 2


New-TableColumnOption -ColumnIndex 0,1,2 -Hidden $false
New-TableColumnOption -ColumnIndex 1 -Sortable $true
New-TableColumnOption -AllColumns -Hidden $true -Searchable $false -Sortable $false
All columns will be hidden, not searchable, and not sortable
However, since there is a option specified higher up, the first 3 columns will be visible
Additionally the 2nd column will be sortable
        

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.

Syntax

New-TableColumnOption -ColumnIndex <Int32[]> [-Hidden <Boolean>] [-Searchable <Boolean>] [-Sortable <Boolean>] [-Width <String>] [<CommonParameters>]
#
Parameter set: ColumnIndex

Parameters

ColumnIndex Int32[] requiredposition: namedpipeline: Falsealiases: Targets
Identifies specific columns that the properties should apply to
Hidden Boolean optionalposition: namedpipeline: False
Defines if a column is hidden. A hidden column can still be used by Conditional Formatting and can still be searchable
Searchable Boolean optionalposition: namedpipeline: False
Defines if a column is able to be searched
Sortable Boolean optionalposition: namedpipeline: False
Defines if a column can be sorted
Width String optionalposition: namedpipeline: False
Width for the column as a string

Outputs

PSCustomObject

New-TableColumnOption -AllColumns [-Hidden <Boolean>] [-Searchable <Boolean>] [-Sortable <Boolean>] [-Width <String>] [<CommonParameters>]
#
Parameter set: AllColumns

Parameters

AllColumns SwitchParameter requiredposition: namedpipeline: Falsealiases: AllTargets, TargetAll
Uses the columnDef Target "_ALL" to indicate all columns / remaining columns
Hidden Boolean optionalposition: namedpipeline: False
Defines if a column is hidden. A hidden column can still be used by Conditional Formatting and can still be searchable
Searchable Boolean optionalposition: namedpipeline: False
Defines if a column is able to be searched
Sortable Boolean optionalposition: namedpipeline: False
Defines if a column can be sorted
Width String optionalposition: namedpipeline: False
Width for the column as a string

Outputs

PSCustomObject