# WordTableBuilder

Collects the header and rows of a table, so the Table(t => ...) keyword can create the table at its final size and then configure each cell through its scope.

Class 

`OfficeIMO.Word`

**Namespace**

`OfficeIMO.Word`

**Assembly**

`OfficeIMO.Word`

**Source revision**

`105ae88c45f6` with working tree changes

**Source**

[WordTableBuilder.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L21)

**Modifiers**

sealed

Collects the header and rows of a table, so the Table(t => ...) keyword can create the table at its final size and then configure each cell through its scope.

## Inheritance

- object
- WordTableBuilder

## Usage

Explore 10 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Method [WordTableBuilder.Columns](/api/word/officeimo-word-wordtablebuilder/#method-columns-int32)
- Method [WordTableBuilder.Configure](/api/word/officeimo-word-wordtablebuilder/#method-configure-action-officeimo-word-wordtablescope)
- Method [WordTableBuilder.Header](/api/word/officeimo-word-wordtablebuilder/#method-header-string)
- Method [WordTableBuilder.Row](/api/word/officeimo-word-wordtablebuilder/#method-row-string)
- Method [WordTableBuilder.Style](/api/word/officeimo-word-wordtablebuilder/#method-style-officeimo-word-wordtablestyle)

### Accepted by parameters 5

- Method [WordDocumentScope.Table](/api/word/officeimo-word-worddocumentscope/#method-table-action-officeimo-word-wordtablebuilder) parameter `compose`
- Method [WordFooterScope.Table](/api/word/officeimo-word-wordfooterscope/#method-table-action-officeimo-word-wordtablebuilder) parameter `compose`
- Method [WordHeaderScope.Table](/api/word/officeimo-word-wordheaderscope/#method-table-action-officeimo-word-wordtablebuilder) parameter `compose`
- Method [WordSectionScope.Table](/api/word/officeimo-word-wordsectionscope/#method-table-action-officeimo-word-wordtablebuilder) parameter `compose`
- Method [WordTableCellScope.Table](/api/word/officeimo-word-wordtablecellscope/#method-table-action-officeimo-word-wordtablebuilder) parameter `compose`

Filter members 

Show inherited

## Methods

`public WordTableBuilder Columns(int count)` [#](#method-columns-int32)

[WordTableBuilder.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L21)

Sets the minimum number of columns. The table is as wide as this or its widest row, whichever is more.

Parameters

**count int required**

Minimum number of columns, at least one.

Returns

`WordTableBuilder` The same builder.

`public WordTableBuilder Configure(Action<WordTableScope> configure)` [#](#method-configure-action-officeimo-word-wordtablescope)

[WordTableBuilder.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L70)

Configures the created table after its cells are filled: width, borders, alignment, title.

Parameters

**configure System.Action<OfficeIMO.Word.WordTableScope> required**

Edits the table through its scope.

Returns

`WordTableBuilder` The same builder.

Header 2 overloads

`public WordTableBuilder Header(params string[] cells)` [#](#method-header-string)

[WordTableBuilder.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L38)

Sets the header row, which repeats at the top of each page and gets the style's first-row formatting.

Parameters

**cells string[] required**

Header texts, one per column.

Returns

`WordTableBuilder` The same builder.

`public WordTableBuilder Header(Action<WordTableRowBuilder> row)` [#](#method-header-action-officeimo-word-wordtablerowbuilder)

[WordTableBuilder.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L46)

Sets the header row, with a scope for each header cell.

Parameters

**row System.Action<OfficeIMO.Word.WordTableRowBuilder> required**

Adds the header cells.

Returns

`WordTableBuilder` The same builder.

Row 2 overloads

`public WordTableBuilder Row(params string[] cells)` [#](#method-row-string)

[WordTableBuilder.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L54)

Adds a row of plain texts.

Parameters

**cells string[] required**

Cell texts, one per column.

Returns

`WordTableBuilder` The same builder.

`public WordTableBuilder Row(Action<WordTableRowBuilder> row)` [#](#method-row-action-officeimo-word-wordtablerowbuilder)

[WordTableBuilder.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L62)

Adds a row whose cells are configured through their scopes.

Parameters

**row System.Action<OfficeIMO.Word.WordTableRowBuilder> required**

Adds the row's cells.

Returns

`WordTableBuilder` The same builder.

`public WordTableBuilder Style(WordTableStyle style)` [#](#method-style-officeimo-word-wordtablestyle)

[WordTableBuilder.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/105ae88c45f6be3bb2020384e25ffe61d990451b/Sources/OfficeIMO.Word/Scopes/WordTableBuilder.cs#L30)

Sets the table style.

Parameters

**style OfficeIMO.Word.WordTableStyle required**

Built-in table style.

Returns

`WordTableBuilder` The same builder.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:BA9E32CFB9C120EE4679E52F98CF6F7A45F1F8189E7531F8ED138E3DF68BF8CD -->
