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

Aliases: New-TableStyle
Namespace PSWriteHTML
Aliases
New-TableStyle

Apply new style for HTML Table

Remarks

Apply new style for HTML Table. Currently only works with DataTables (javascript). It doesn't affect CSS only tables (emails, etc). Keep in mind this affects all tables, not just one.

Examples

Authored help example

EXAMPLE 1


$Table = Get-Process | Select-Object -First 3
        

New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Yellow -TextColor Aquamarine -TextAlign center -Type RowOdd New-HTMLTableStyle -BackgroundColor Red -TextColor Aquamarine -Type Button New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor DarkSlateGray -TextColor Aquamarine -TextAlign center -Type RowEven New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor DarkSlateGray -TextColor Aquamarine -TextAlign center -Type Row New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor DarkSlateGray -TextColor Aquamarine -TextAlign center -Type Header New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Orange -TextColor Aquamarine -TextAlign center -Type Footer New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Orange -TextColor Aquamarine -TextAlign center -Type RowSelectedEven New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Green -TextColor Aquamarine -TextAlign center -Type RowSelectedOdd New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Yellow -TextColor Aquamarine -TextAlign center -Type RowHover New-HTMLTableStyle -FontFamily 'Calibri' -BackgroundColor Red -TextColor Aquamarine -TextAlign center -Type RowHoverSelected New-HTMLTableStyle -Type Header -BorderLeftStyle dashed -BorderLeftColor Red -BorderLeftWidthSize 1px New-HTMLTableStyle -Type Footer -BorderLeftStyle dotted -BorderLeftColor Red -BorderleftWidthSize 1px New-HTMLTableStyle -Type Footer -BorderTopStyle none -BorderTopColor Red -BorderTopWidthSize 5px -BorderBottomColor Yellow -BorderBottomStyle solid New-HTMLTableStyle -Type Footer -BorderTopStyle none -BorderTopColor Red -BorderTopWidthSize 5px -BorderBottomColor Yellow -BorderBottomStyle solid New-HTMLTableStyle -Type Footer -BorderTopStyle none -BorderTopColor Red -BorderTopWidthSize 5px -BorderBottomColor Yellow -BorderBottomStyle none

New-HTML -ShowHTML -HtmlData { New-HTMLTable -DataTable $table -HideButtons {

} -DisablePaging } -FilePath $PSScriptRoot\Example7_TableStyle.html -Online

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-HTMLTableStyle [-BackgroundColor <String>] [-BorderBottomColor <String>] [-BorderBottomStyle <hidden>] [-BorderBottomWidthSize <String>] [-BorderLeftColor <String>] [-BorderLeftStyle <hidden>] [-BorderLeftWidthSize <String>] [-BorderRightColor <String>] [-BorderRightStyle <hidden>] [-BorderRightWidthSize <String>] [-BorderTopColor <String>] [-BorderTopStyle <hidden>] [-BorderTopWidthSize <String>] [-FontFamily <String>] [-FontSize <String>] [-FontStyle <normal|italic|oblique>] [-FontVariant <normal|small-caps>] [-FontWeight <normal>] [-TextAlign <left|right|center|justify>] [-TextColor <String>] [-TextDecoration <line-through|overline|underline>] [-TextTransform <uppercase|lowercase|capitalize>] [-Type <Content>] [<CommonParameters>]
#
Parameter set: Manual

Parameters

BackgroundColor String optionalposition: namedpipeline: False
Set the background color. Choose one of the 800 colors or provide a hex value.
BorderBottomColor String optionalposition: namedpipeline: False
Set the border color for the bottom border
BorderBottomStyle Object optionalposition: namedpipeline: Falsevalues: 9
Set the border style for the bottom border. Allowed options are: 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'
Possible values: hidden, dotted, dashed, solid, double, groove, ridge, inset, outset
BorderBottomWidthSize String optionalposition: namedpipeline: False
Set the border width for the bottom border
BorderLeftColor String optionalposition: namedpipeline: False
Set the border color for the left border
BorderLeftStyle Object optionalposition: namedpipeline: Falsevalues: 9
Set the border style for the left border. Allowed options are: 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'
Possible values: hidden, dotted, dashed, solid, double, groove, ridge, inset, outset
BorderLeftWidthSize String optionalposition: namedpipeline: False
Set the border width for the left border
BorderRightColor String optionalposition: namedpipeline: False
Set the border color for the right border
BorderRightStyle Object optionalposition: namedpipeline: Falsevalues: 9
Set the border style for the right border. Allowed options are: 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'
Possible values: hidden, dotted, dashed, solid, double, groove, ridge, inset, outset
BorderRightWidthSize String optionalposition: namedpipeline: False
Set the border width for the right border
BorderTopColor String optionalposition: namedpipeline: False
Set the border color for the top border
BorderTopStyle Object optionalposition: namedpipeline: Falsevalues: 9
Set the border style for the top border. Allowed options are: 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'
Possible values: hidden, dotted, dashed, solid, double, groove, ridge, inset, outset
BorderTopWidthSize String optionalposition: namedpipeline: False
Set the border width for the top border
FontFamily String optionalposition: namedpipeline: False
Specify the font to be used for text.
FontSize String optionalposition: namedpipeline: Falsealiases: TextSize
Set font size for the text.
FontStyle String optionalposition: namedpipeline: Falsevalues: 3
Set different font styles to be used for text. Allowed styles: 'normal', 'italic', 'oblique'
Possible values: normal, italic, oblique
FontVariant String optionalposition: namedpipeline: Falsevalues: 2
Set different font variant to be used for text. Allowed variants: 'normal', 'small-caps'. In a small-caps font, all lowercase letters are converted to uppercase letters. However, the converted uppercase letters appears in a smaller font size than the original uppercase letters in the text.
Possible values: normal, small-caps
FontWeight String optionalposition: namedpipeline: Falsevalues: 13
Set font weight for the text. Allowed options: 'normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'
Possible values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900
TextAlign String optionalposition: namedpipeline: Falsealiases: Align, FontAlignvalues: 4
Set the text alignment. Allowed options are: 'left', 'right', 'center', 'justify'
Possible values: left, right, center, justify
TextColor String optionalposition: namedpipeline: False
Set the text color. Choose one of the 800 colors or provide a hex value.
TextDecoration String optionalposition: namedpipeline: Falsevalues: 3
Set different font decoration. Allowed options are: 'none', 'line-through', 'overline', 'underline'
Possible values: line-through, overline, underline
TextTransform String optionalposition: namedpipeline: Falsevalues: 3
Set different text transform. Allowed options are: 'uppercase', 'lowercase', 'capitalize'
Possible values: uppercase, lowercase, capitalize
Type String optionalposition: namedpipeline: Falsevalues: 13
Choose type to apply style on. You can choose from: 'Content', 'Table', 'Header', 'Row', 'Footer', 'RowOdd', 'RowEven', 'RowSelected', 'RowSelectedEven', 'RowSelectedOdd', 'RowHover', 'RowHoverSelected', 'Button'. Content is duplicate to Row.
Possible values: Content, Table, Header, Row, Footer, RowOdd, RowEven, RowSelected, RowSelectedEven, RowSelectedOdd, RowHover, RowHoverSelected, Button