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-HTMLTable

Namespace PSWriteHTML

Creates a new HTML table with various customization options.

Remarks

This function generates an HTML table based on the provided data and allows for extensive customization using a wide range of parameters.

Examples

Authored help example

EXAMPLE 1


$data = @(
    [PSCustomObject]@{ Name = 'John'; Age = 30 },
    [PSCustomObject]@{ Name = 'Jane'; Age = 25 }
)
New-HTMLTable -DataTable $data -Title 'User Information' -Buttons @('copyHtml5', 'excelHtml5') -PagingStyle 'full_numbers' -PagingOptions @(10, 25, 50) -DefaultSortColumn @('Name') -DefaultSortOrder @('Ascending')
        

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-HTMLTable [-AllProperties] [-AlphabetSearch] [-AutoSize] [-Buttons <copyHtml5>] [-Compare] [-CompareNames <Array>] [-CompareReplace <Array>] [-DataStore <HTML|JavaScript|AjaxJSON>] [-DataStoreID <String>] [-DataTable <Array>] [-DataTableID <String>] [-DateTimeSortingFormat <String[]>] [-DefaultSortColumn <String[]>] [-DefaultSortIndex <Int32[]>] [-DefaultSortOrder <Ascending|Descending>] [-DisableAutoWidthOptimization] [-DisableInfo] [-DisableNewLine] [-DisableOrdering] [-DisablePaging] [-DisableProcessing] [-DisableResponsiveTable] [-DisableSearch] [-DisableSelect] [-DisableStateSave] [-EnableAutoFill] [-EnableColumnReorder] [-EnableKeys] [-EnableRowReorder] [-EnableScroller] [-ExcludeProperty <String[]>] [-Filtering] [-FilteringLocation <Top|Bottom|Both>] [-Find <String>] [-First <Int32>] [-FixedFooter] [-FixedHeader] [-FlattenDepth <Int32>] [-FlattenObject] [-FreezeColumnsLeft <Int32>] [-FreezeColumnsRight <Int32>] [-FuzzySearch] [-FuzzySearchSmartToggle] [-HideButtons] [-HideFooter] [-HideShowButton] [-HighlightDifferences] [-HTML <ScriptBlock>] [-ImmediatelyShowHiddenDetails] [-IncludeProperty <String[]>] [-InvokeHTMLTags] [-Last <Int32>] [-OrderMulti] [-OverwriteDOM <String>] [-PagingLength <Int32>] [-PagingOptions <Int32[]>] [-PagingStyle <numbers>] [-PostContent <ScriptBlock>] [-PreContent <ScriptBlock>] [-PrettifyObject] [-PrettifyObjectDateTimeFormat <String>] [-PrettifyObjectSeparator <String>] [-PriorityProperties <String[]>] [-ResponsivePriorityOrder <String[]>] [-ResponsivePriorityOrderIndex <Int32[]>] [-ScreenSizePercent <Int32>] [-ScrollCollapse] [-ScrollSizeY <Int32>] [-ScrollX] [-ScrollY] [-SearchBuilder] [-SearchBuilderLocation <top|bottom>] [-SearchHighlight] [-SearchPane] [-SearchPaneLocation <top|bottom>] [-SearchRegularExpression] [-Simplify] [-SkipProperties] [-Style <display>] [-TextWhenNoData <String>] [-Title <String>] [-Transpose] [-TransposeLegacy] [-TransposeName <String>] [-TransposeProperty <String>] [-Width <Object>] [-WordBreak <normal|break-all|keep-all|break-word>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AllProperties SwitchParameter optionalposition: namedpipeline: False
Displays all properties in the table.
AlphabetSearch SwitchParameter optionalposition: namedpipeline: False
Enables alphabet search.
AutoSize SwitchParameter optionalposition: namedpipeline: False
Automatically sizes the table.
Buttons String[] optionalposition: namedpipeline: Falsevalues: 10
An array of buttons to be displayed in the table for actions like copying, exporting, and printing.
Possible values: copyHtml5, excelHtml5, csvHtml5, pdfHtml5, pageLength, print, searchPanes, searchBuilder, columnVisibility, toggleView
Compare SwitchParameter optionalposition: namedpipeline: False
Compares data in the table.
CompareNames Array optionalposition: namedpipeline: False
Names to compare in the table.
CompareReplace Array optionalposition: namedpipeline: Falsealiases: Replace
Replaces data for comparison.
DataStore String optionalposition: namedpipeline: Falsevalues: 3
Stores data for the table.
Possible values: HTML, JavaScript, AjaxJSON
DataStoreID String optionalposition: namedpipeline: False
The ID of the data store.
DataTable Array optionalposition: namedpipeline: Falsealiases: ArrayOfObjects, Object, Table
An array of objects containing the data to be displayed in the table.
DataTableID String optionalposition: namedpipeline: Falsealiases: DataTableName
The ID of the data table.
DateTimeSortingFormat String[] optionalposition: namedpipeline: False
An array of date-time formats for sorting.
DefaultSortColumn String[] optionalposition: namedpipeline: False
An array of default columns to sort by.
DefaultSortIndex Int32[] optionalposition: namedpipeline: False
An array of default column indexes to sort by.
DefaultSortOrder String[] optionalposition: namedpipeline: Falsevalues: 2
The default sort order (Ascending, Descending).
Possible values: Ascending, Descending
DisableAutoWidthOptimization SwitchParameter optionalposition: namedpipeline: False
Disables auto width optimization.
DisableInfo SwitchParameter optionalposition: namedpipeline: False
Disables information display at the bottom of the table.
DisableNewLine SwitchParameter optionalposition: namedpipeline: False
Disables new line characters in the table.
DisableOrdering SwitchParameter optionalposition: namedpipeline: False
Disables column ordering in the table.
DisablePaging SwitchParameter optionalposition: namedpipeline: False
Disables pagination in the table.
DisableProcessing SwitchParameter optionalposition: namedpipeline: False
Disables processing indicator in the table.
DisableResponsiveTable SwitchParameter optionalposition: namedpipeline: False
Disables responsiveness of the table.
DisableSearch SwitchParameter optionalposition: namedpipeline: False
Disables search functionality in the table.
DisableSelect SwitchParameter optionalposition: namedpipeline: False
Disables row selection in the table.
DisableStateSave SwitchParameter optionalposition: namedpipeline: False
Disables saving the state of the table.
EnableAutoFill SwitchParameter optionalposition: namedpipeline: False
Enables auto-filling in the table.
EnableColumnReorder SwitchParameter optionalposition: namedpipeline: False
Enables column reordering in the table.
EnableKeys SwitchParameter optionalposition: namedpipeline: False
Enables keyboard navigation in the table.
EnableRowReorder SwitchParameter optionalposition: namedpipeline: False
Enables row reordering in the table.
EnableScroller SwitchParameter optionalposition: namedpipeline: False
Enables table scrolling.
ExcludeProperty String[] optionalposition: namedpipeline: False
Properties to exclude from the table.
Filtering SwitchParameter optionalposition: namedpipeline: False
Enables filtering in the table.
FilteringLocation String optionalposition: namedpipeline: Falsevalues: 3
Specifies the location of the filter (Top, Bottom, Both).
Possible values: Top, Bottom, Both
Find String optionalposition: namedpipeline: Falsealiases: Search
Search string to find in the table.
First Int32 optionalposition: namedpipeline: False
Displays the first item in the table.
FixedFooter SwitchParameter optionalposition: namedpipeline: False
Fixes the footer of the table.
FixedHeader SwitchParameter optionalposition: namedpipeline: False
Fixes the header of the table.
FlattenDepth Int32 optionalposition: namedpipeline: False
The depth to flatten the object.
FlattenObject SwitchParameter optionalposition: namedpipeline: False
Flattens the object for display.
FreezeColumnsLeft Int32 optionalposition: namedpipeline: False
The number of columns to freeze on the left.
FreezeColumnsRight Int32 optionalposition: namedpipeline: False
The number of columns to freeze on the right.
FuzzySearch SwitchParameter optionalposition: namedpipeline: False
Enables fuzzy search.
FuzzySearchSmartToggle SwitchParameter optionalposition: namedpipeline: False
Toggles smart fuzzy search.
HideButtons SwitchParameter optionalposition: namedpipeline: Falsealiases: DisableButtons
Hides all buttons in the table.
HideFooter SwitchParameter optionalposition: namedpipeline: False
Hides the footer of the table.
HideShowButton SwitchParameter optionalposition: namedpipeline: Falsealiases: RemoveShowButton
Displays a button to show/hide details.
HighlightDifferences SwitchParameter optionalposition: namedpipeline: Falsealiases: CompareWithColors
Highlights differences in the table.
HTML ScriptBlock optionalposition: 0pipeline: False
The HTML content to be included before the table.
ImmediatelyShowHiddenDetails SwitchParameter optionalposition: namedpipeline: False
Shows hidden details immediately.
IncludeProperty String[] optionalposition: namedpipeline: False
Properties to include in the table.
InvokeHTMLTags SwitchParameter optionalposition: namedpipeline: False
Enables HTML tags in the table.
Last Int32 optionalposition: namedpipeline: False
Displays the last item in the table.
OrderMulti SwitchParameter optionalposition: namedpipeline: False
Allows multiple column ordering in the table.
OverwriteDOM String optionalposition: namedpipeline: False
Overwrites the DOM structure.
PagingLength Int32 optionalposition: namedpipeline: False
The default number of items to display per page.
PagingOptions Int32[] optionalposition: namedpipeline: False
An array of options for the number of items to display per page.
PagingStyle String[] optionalposition: namedpipeline: Falsevalues: 6
The style of pagination to be used in the table.
Possible values: numbers, simple, simple_numbers, full, full_numbers, first_last_numbers
PostContent ScriptBlock optionalposition: 2pipeline: False
Additional content to be included after the table.
PreContent ScriptBlock optionalposition: 1pipeline: False
Additional content to be included before the table.
PrettifyObject SwitchParameter optionalposition: namedpipeline: False
Forces object to be preprocessed before passing to HTML. This is useful when converting object with arrays or when there is a need to display DateTime in different format. This is mostly useful for email tables or when using DataStore HTML.
PrettifyObjectDateTimeFormat String optionalposition: namedpipeline: False
DateTime format for prettified object.
PrettifyObjectSeparator String optionalposition: namedpipeline: False
Define separator for prettified array object. Default is ", ".
PriorityProperties String[] optionalposition: namedpipeline: False
Properties to prioritize in the table.
ResponsivePriorityOrder String[] optionalposition: namedpipeline: False
The priority order for responsiveness.
ResponsivePriorityOrderIndex Int32[] optionalposition: namedpipeline: False
The index for responsive priority order.
ScreenSizePercent Int32 optionalposition: namedpipeline: False
The percentage of the screen width to occupy.
ScrollCollapse SwitchParameter optionalposition: namedpipeline: False
Collapses the table when scrolling.
ScrollSizeY Int32 optionalposition: namedpipeline: False
The height of the vertical scroll.
ScrollX SwitchParameter optionalposition: namedpipeline: False
Enables horizontal scrolling.
ScrollY SwitchParameter optionalposition: namedpipeline: False
Enables vertical scrolling.
SearchBuilder SwitchParameter optionalposition: namedpipeline: False
Enables search builder in the table.
SearchBuilderLocation String optionalposition: namedpipeline: Falsevalues: 2
Specifies the location of the search builder.
Possible values: top, bottom
SearchHighlight SwitchParameter optionalposition: namedpipeline: False
Highlights search results.
SearchPane SwitchParameter optionalposition: namedpipeline: False
Enables search pane in the table.
SearchPaneLocation String optionalposition: namedpipeline: Falsevalues: 2
Specifies the location of the search pane.
Possible values: top, bottom
SearchRegularExpression SwitchParameter optionalposition: namedpipeline: Falsealiases: RegularExpression
Enables regular expression search.
Simplify SwitchParameter optionalposition: namedpipeline: False
Simplifies the table layout.
SkipProperties SwitchParameter optionalposition: namedpipeline: False
Properties to skip in the table.
Style String[] optionalposition: namedpipeline: Falsevalues: 8
An array of styles to apply to the table.
Possible values: display, cell-border, compact, hover, nowrap, order-column, row-border, stripe
TextWhenNoData String optionalposition: namedpipeline: False
The text to display when no data is available.
Title String optionalposition: namedpipeline: False
The title of the HTML table.
Transpose SwitchParameter optionalposition: namedpipeline: False
Transpose table. This is useful when you have objects and you want to transpose them.
TransposeLegacy SwitchParameter optionalposition: namedpipeline: False
Use old method of transposing table. This is useful when you have objects and you want to transpose them, using legacy method.
TransposeName String optionalposition: namedpipeline: False
Name of the column that will be used per object to transpose table. By default it's "Object X", "Object Y", "Object Z" etc.
TransposeProperty String optionalposition: namedpipeline: False
Transpose table based on property. By default it's "Object X". This makes sense if you have unique value per object that you want to transpose table based on.
Width Object optionalposition: namedpipeline: False
WordBreak String optionalposition: namedpipeline: Falsevalues: 4
Enables word breaking in the table.
Possible values: normal, break-all, keep-all, break-word