API Reference
New-HTMLTableStyle
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
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>]
#
ManualParameters
- BackgroundColor String
- Set the background color. Choose one of the 800 colors or provide a hex value.
- BorderBottomColor String
- Set the border color for the bottom border
- BorderBottomStyle Object
- 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
- Set the border width for the bottom border
- BorderLeftColor String
- Set the border color for the left border
- BorderLeftStyle Object
- 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
- Set the border width for the left border
- BorderRightColor String
- Set the border color for the right border
- BorderRightStyle Object
- 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
- Set the border width for the right border
- BorderTopColor String
- Set the border color for the top border
- BorderTopStyle Object
- 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
- Set the border width for the top border
- FontFamily String
- Specify the font to be used for text.
- FontSize String
- Set font size for the text.
- FontStyle String
- Set different font styles to be used for text. Allowed styles: 'normal', 'italic', 'oblique'
- Possible values:
normal,italic,oblique - FontVariant String
- 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
- 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
- Set the text alignment. Allowed options are: 'left', 'right', 'center', 'justify'
- Possible values:
left,right,center,justify - TextColor String
- Set the text color. Choose one of the 800 colors or provide a hex value.
- TextDecoration String
- Set different font decoration. Allowed options are: 'none', 'line-through', 'overline', 'underline'
- Possible values:
line-through,overline,underline - TextTransform String
- Set different text transform. Allowed options are: 'uppercase', 'lowercase', 'capitalize'
- Possible values:
uppercase,lowercase,capitalize - Type String
- 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