API Reference
Function
New-HTMLTable
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
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 SetsParameters
- AllProperties SwitchParameter
- Displays all properties in the table.
- AlphabetSearch SwitchParameter
- Enables alphabet search.
- AutoSize SwitchParameter
- Automatically sizes the table.
- Buttons String[]
- 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
- Compares data in the table.
- CompareNames Array
- Names to compare in the table.
- CompareReplace Array
- Replaces data for comparison.
- DataStore String
- Stores data for the table.
- Possible values:
HTML,JavaScript,AjaxJSON - DataStoreID String
- The ID of the data store.
- DataTable Array
- An array of objects containing the data to be displayed in the table.
- DataTableID String
- The ID of the data table.
- DateTimeSortingFormat String[]
- An array of date-time formats for sorting.
- DefaultSortColumn String[]
- An array of default columns to sort by.
- DefaultSortIndex Int32[]
- An array of default column indexes to sort by.
- DefaultSortOrder String[]
- The default sort order (Ascending, Descending).
- Possible values:
Ascending,Descending - DisableAutoWidthOptimization SwitchParameter
- Disables auto width optimization.
- DisableInfo SwitchParameter
- Disables information display at the bottom of the table.
- DisableNewLine SwitchParameter
- Disables new line characters in the table.
- DisableOrdering SwitchParameter
- Disables column ordering in the table.
- DisablePaging SwitchParameter
- Disables pagination in the table.
- DisableProcessing SwitchParameter
- Disables processing indicator in the table.
- DisableResponsiveTable SwitchParameter
- Disables responsiveness of the table.
- DisableSearch SwitchParameter
- Disables search functionality in the table.
- DisableSelect SwitchParameter
- Disables row selection in the table.
- DisableStateSave SwitchParameter
- Disables saving the state of the table.
- EnableAutoFill SwitchParameter
- Enables auto-filling in the table.
- EnableColumnReorder SwitchParameter
- Enables column reordering in the table.
- EnableKeys SwitchParameter
- Enables keyboard navigation in the table.
- EnableRowReorder SwitchParameter
- Enables row reordering in the table.
- EnableScroller SwitchParameter
- Enables table scrolling.
- ExcludeProperty String[]
- Properties to exclude from the table.
- Filtering SwitchParameter
- Enables filtering in the table.
- FilteringLocation String
- Specifies the location of the filter (Top, Bottom, Both).
- Possible values:
Top,Bottom,Both - Find String
- Search string to find in the table.
- First Int32
- Displays the first item in the table.
- FixedFooter SwitchParameter
- Fixes the footer of the table.
- FixedHeader SwitchParameter
- Fixes the header of the table.
- FlattenDepth Int32
- The depth to flatten the object.
- FlattenObject SwitchParameter
- Flattens the object for display.
- FreezeColumnsLeft Int32
- The number of columns to freeze on the left.
- FreezeColumnsRight Int32
- The number of columns to freeze on the right.
- FuzzySearch SwitchParameter
- Enables fuzzy search.
- FuzzySearchSmartToggle SwitchParameter
- Toggles smart fuzzy search.
- HideButtons SwitchParameter
- Hides all buttons in the table.
- HideFooter SwitchParameter
- Hides the footer of the table.
- HideShowButton SwitchParameter
- Displays a button to show/hide details.
- HighlightDifferences SwitchParameter
- Highlights differences in the table.
- HTML ScriptBlock
- The HTML content to be included before the table.
- ImmediatelyShowHiddenDetails SwitchParameter
- Shows hidden details immediately.
- IncludeProperty String[]
- Properties to include in the table.
- InvokeHTMLTags SwitchParameter
- Enables HTML tags in the table.
- Last Int32
- Displays the last item in the table.
- OrderMulti SwitchParameter
- Allows multiple column ordering in the table.
- OverwriteDOM String
- Overwrites the DOM structure.
- PagingLength Int32
- The default number of items to display per page.
- PagingOptions Int32[]
- An array of options for the number of items to display per page.
- PagingStyle String[]
- The style of pagination to be used in the table.
- Possible values:
numbers,simple,simple_numbers,full,full_numbers,first_last_numbers - PostContent ScriptBlock
- Additional content to be included after the table.
- PreContent ScriptBlock
- Additional content to be included before the table.
- PrettifyObject SwitchParameter
- 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
- DateTime format for prettified object.
- PrettifyObjectSeparator String
- Define separator for prettified array object. Default is ", ".
- PriorityProperties String[]
- Properties to prioritize in the table.
- ResponsivePriorityOrder String[]
- The priority order for responsiveness.
- ResponsivePriorityOrderIndex Int32[]
- The index for responsive priority order.
- ScreenSizePercent Int32
- The percentage of the screen width to occupy.
- ScrollCollapse SwitchParameter
- Collapses the table when scrolling.
- ScrollSizeY Int32
- The height of the vertical scroll.
- ScrollX SwitchParameter
- Enables horizontal scrolling.
- ScrollY SwitchParameter
- Enables vertical scrolling.
- SearchBuilder SwitchParameter
- Enables search builder in the table.
- SearchBuilderLocation String
- Specifies the location of the search builder.
- Possible values:
top,bottom - SearchHighlight SwitchParameter
- Highlights search results.
- SearchPane SwitchParameter
- Enables search pane in the table.
- SearchPaneLocation String
- Specifies the location of the search pane.
- Possible values:
top,bottom - SearchRegularExpression SwitchParameter
- Enables regular expression search.
- Simplify SwitchParameter
- Simplifies the table layout.
- SkipProperties SwitchParameter
- Properties to skip in the table.
- Style String[]
- An array of styles to apply to the table.
- Possible values:
display,cell-border,compact,hover,nowrap,order-column,row-border,stripe - TextWhenNoData String
- The text to display when no data is available.
- Title String
- The title of the HTML table.
- Transpose SwitchParameter
- Transpose table. This is useful when you have objects and you want to transpose them.
- TransposeLegacy SwitchParameter
- Use old method of transposing table. This is useful when you have objects and you want to transpose them, using legacy method.
- TransposeName String
- 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
- 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
- WordBreak String
- Enables word breaking in the table.
- Possible values:
normal,break-all,keep-all,break-word