# New-TableContent

Provide a way to style or overwrite the table content with new content or style.

Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML/1.40.0)

Stars **1,025**

Forks **114**

Open issues 

PowerShell Gallery downloads **7,576,901**

Release **v1.45.0**

Language: PowerShell Updated: 2026-11-19

Command 

**Module**

`PSWriteHTML`

Provide a way to style or overwrite the table content with new content or style

## Syntax

```
New-TableContent
[[-Alignment] <left|center|right|justify>]
[[-BackGroundColor] <String>]
[[-Color] <String>]
[[-ColumnIndex] <Int32[]>]
[[-ColumnName] <String[]>]
[[-Direction] <rtl|ltr>]
[[-FontFamily] <String>]
[[-FontSize] <Object>]
[[-FontStyle] <normal|italic|oblique>]
[[-FontVariant] <normal|small-caps>]
[[-FontWeight] <String>]
[[-RowIndex] <Int32[]>]
[[-Text] <String[]>]
[[-TextDecoration] <line-through|overline|underline>]
[[-TextTransform] <uppercase|lowercase|capitalize>]
[[-WordBreak] <normal|break-all|keep-all|break-word>]
[<CommonParameters>]
```

[#](#method-new-tablecontent-string-string-string-int32-string-string-string-object-string-string-string-int32-string-string-string-string)

Parameter set: `All Parameter Sets`

## Examples

### Example 1

```powershell
New-HTML -TitleText "Example37 - Word Breaking" -FilePath "$PSScriptRoot\Example37.html" {
    New-HTMLSection -HeaderText "Word Break for whole table" -HeaderTextAlignment center -Content {
        New-HTMLTable -DataTable $(Get-Process | Select-Object -First 5) -WordBreak 'break-word'
    }
    New-HTMLSection -HeaderText "Word Break per column" -HeaderTextAlignment center -Content {
        New-HTMLTable -DataTable $(Get-Process | Select-Object -First 5) {
            New-TableContent -WordBreak break-all -ColumnName 'Path'
        }
    }
    New-HTMLSection -HeaderText "No word break" -HeaderTextAlignment center -Content {
        New-HTMLTable -DataTable $(Get-Process | Select-Object -First 5)
    }
} -Online -ShowHTML
```

### Example 2

```powershell
$Values = @(
    [PSCustomObject] @{
        Test1 = 1
        Test2 = 2
        Test3 = 3
        Test4 = 1
    }
    [PSCustomObject] @{
        Test1 = 1
        Test2 = 2
        Test3 = 3
        Test4 = 1
    }
    [PSCustomObject] @{
        Test1 = 1
        Test2 = 2
        Test3 = 3
        Test4 = 2
    }
    [PSCustomObject] @{
        Test1 = 1
        Test2 = 2
        Test3 = 3
        Test4 = 1
    }
    [PSCustomObject] @{
        Test1 = 1
        Test2 = 2
        Test3 = 3
        Test4 = 1
    }
    [PSCustomObject] @{
        Test1 = 1
        Test2 = 2
        Test3 = 3
        Test4 = 2
    }
)
```

New-HTML -TitleText "Example41 - Table" -FilePath "$PSScriptRoot\Example41.html" { New-HTMLSection -HeaderText "Testing" -HeaderTextAlignment center -Content { New-HTMLTable -DataTable $Values { for ($i = 0; $i -le $Values.Count; $i++) { if ($Values[$i].Test1 -ne $Values[$i].Test4) { New-TableContent -BackGroundColor Red -ColumnName 'Test4' -RowIndex ($i+1) } } } } } -Online -ShowHTML

## Parameters

**-Alignment String optionalposition: 11**

Provide new alignment. When skipped the alignment will not be changed. Options are: 'left', 'center', 'right', 'justify'

Possible values: `left`, `center`, `right`, `justify`

**-BackGroundColor String optionalposition: 5**

Pick one of the 800 colors or provide a hex color code.

**-Color String optionalposition: 4**

Pick one of the 800 colors or provide a hex color code.

**-ColumnIndex Int32[] optionalposition: 1**

Define column index to search where to replace the content or style. Conflicts with ColumnName. Choose one or the other.

**-ColumnName String[] optionalposition: 0aliases: ColumnNames, Name, Names**

Define column name to search where to replace the content or style. Conflicts with ColumnIndex. Choose one or the other.

**-Direction String optionalposition: 14**

Provide new direction. When skipped the direction will not be changed. Options are: 'rtl','ltr'. By default it's 'ltr'.

Possible values: `rtl`, `ltr`

**-FontFamily String optionalposition: 10**

Provide new font family. When skipped the font family will not be changed.

**-FontSize Object optionalposition: 6**

Provide new font size. When skipped the font size will not be changed.

**-FontStyle String optionalposition: 8**

Provide new font style. When skipped the font style will not be changed. Options are: 'normal', 'italic', 'oblique'

Possible values: `normal`, `italic`, `oblique`

**-FontVariant String optionalposition: 9**

Provide new font variant. When skipped the font variant will not be changed. Options are: 'normal', 'small-caps'

Possible values: `normal`, `small-caps`

**-FontWeight String optionalposition: 7**

Provide new font weight. When skipped the font weight will not be changed. Options are: '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`

**-RowIndex Int32[] optionalposition: 2**

Define row index to search where to replace the content or style.

**-Text String[] optionalposition: 3**

Overwrite the text content of the cell. If not defined the cell will be styled only.

**-TextDecoration String optionalposition: 12**

Provide new text decoration. When skipped the text decoration will not be changed. Options are: 'none', 'line-through', 'overline', 'underline'

Possible values: `line-through`, `overline`, `underline`

**-TextTransform String optionalposition: 13**

Provide new text transform. When skipped the text transform will not be changed. Options are: 'uppercase', 'lowercase', 'capitalize'

Possible values: `uppercase`, `lowercase`, `capitalize`

**-WordBreak String optionalposition: 15**

Provide new word break. When skipped the word break will not be changed. Options are: 'normal', 'break-all', 'keep-all', 'break-word'

Possible values: `normal`, `break-all`, `keep-all`, `break-word`

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:43C09459CDCA4E2E6C395873A923A648C5E73DFD744556BFF80AA0BF55EE85F9 -->
