OfficeIMO

API Reference

Class

TableBuilder (Fluent)

Namespace OfficeIMO.Word.Fluent
Assembly OfficeIMO.Word

Builder for tables.

Inheritance

  • Object
  • TableBuilder

Methods

public TableBuilder Align(HorizontalAlignment alignment) #
Returns: TableBuilder

Sets horizontal alignment for the table.

Parameters

alignment OfficeIMO.HorizontalAlignment requiredposition: 0
public TableBuilder Cell(Int32 row, Int32 column, Action<WordTableCell> action) #
Returns: TableBuilder

Performs an action on the specified cell using 1-based row and column indices.

Parameters

row System.Int32 requiredposition: 0
column System.Int32 requiredposition: 1
action System.Action{OfficeIMO.Word.WordTableCell} requiredposition: 2
public TableBuilder CellStyle(Int32 row, Int32 column, Action<WordTableCell> action) #
Returns: TableBuilder

Applies an action to style a specific cell using 1-based coordinates.

Parameters

row System.Int32 requiredposition: 0
column System.Int32 requiredposition: 1
action System.Action{OfficeIMO.Word.WordTableCell} requiredposition: 2
public TableBuilder Columns(Int32 columns) #
Returns: TableBuilder

Sets the number of columns for the table.

Parameters

columns System.Int32 requiredposition: 0
public TableBuilder ColumnStyle(Int32 index, Action<WordTableCell> action) #
Returns: TableBuilder

Applies an action to each cell in a specified column.

Parameters

index System.Int32 requiredposition: 0
action System.Action{OfficeIMO.Word.WordTableCell} requiredposition: 1
public TableBuilder ColumnWidth(Int32 columnIndex, Double widthPoints) #
Returns: TableBuilder

Sets the width for the specified column in points.

Parameters

columnIndex System.Int32 requiredposition: 0
widthPoints System.Double requiredposition: 1
public TableBuilder ColumnWidthsPercentage(params Int32[] percentages) #
Returns: TableBuilder

Sets column widths using percentage values.

Parameters

percentages System.Int32[] requiredposition: 0
public TableBuilder Create(Int32 rows, Int32 columns) #
Returns: TableBuilder

Creates the table with the specified size.

Parameters

rows System.Int32 requiredposition: 0
Number of rows.
columns System.Int32 requiredposition: 1
Number of columns.

Returns

The current TableBuilder.

public TableBuilder DeleteColumn(Int32 index) #
Returns: TableBuilder

Deletes the column at the specified 1-based index.

Parameters

index System.Int32 requiredposition: 0
public TableBuilder DeleteRow(Int32 index) #
Returns: TableBuilder

Deletes the row at the specified 1-based index.

Parameters

index System.Int32 requiredposition: 0
ForEachCell 2 overloads
public TableBuilder ForEachCell(Action<Int32, Int32, WordTableCell> action) #
Returns: TableBuilder

Populates all cells using the provided text factory.

Parameters

textFactory System.Func{System.Int32,System.Int32,System.String} requiredposition: 0
ForEachCell(System.Action{System.Int32,System.Int32,OfficeIMO.Word.WordTableCell} action) #

Executes an action for each cell in the table.

Parameters

action System.Action{System.Int32,System.Int32,OfficeIMO.Word.WordTableCell} required
public TableBuilder From2D(Object[] data) #
Returns: TableBuilder

Creates the table from a two-dimensional array.

Parameters

data System.Object[0:,0:] requiredposition: 0
public TableBuilder Header(params Object[] cells) #
Returns: TableBuilder

Adds a header row to the table.

Parameters

cells System.Object[] requiredposition: 0
public TableBuilder HeaderRow(Int32 index) #
Returns: TableBuilder

Marks a specified row as the header row.

Parameters

index System.Int32 requiredposition: 0
public TableBuilder Headers(params String[] headers) #
Returns: TableBuilder

Sets header cells using strings (Markdown parity helper).

Parameters

headers System.String[] requiredposition: 0
public TableBuilder InsertColumn(Int32 index, params Object[] cells) #
Returns: TableBuilder

Inserts a column at the specified 1-based index.

Parameters

index System.Int32 requiredposition: 0
cells System.Object[] requiredposition: 1
public TableBuilder InsertRow(Int32 index, params Object[] cells) #
Returns: TableBuilder

Inserts a row at the specified 1-based index.

Parameters

index System.Int32 requiredposition: 0
cells System.Object[] requiredposition: 1
public TableBuilder Merge(Int32 fromRow, Int32 fromColumn, Int32 toRow, Int32 toColumn) #
Returns: TableBuilder

Merges a rectangular range of cells using 1-based coordinates.

Parameters

fromRow System.Int32 requiredposition: 0
fromColumn System.Int32 requiredposition: 1
toRow System.Int32 requiredposition: 2
toColumn System.Int32 requiredposition: 3
public TableBuilder PreferredWidth(Nullable<Int32> percent = null, Nullable<Int32> points = null) #
Returns: TableBuilder

Sets the preferred width of the table.

Parameters

percent System.Nullable{System.Int32} = null optionalposition: 0
points System.Nullable{System.Int32} = null optionalposition: 1
public TableBuilder Row(params Object[] cells) #
Returns: TableBuilder

Adds a row to the table.

Parameters

cells System.Object[] requiredposition: 0
public TableBuilder RowHeight(Int32 rowIndex, Double heightPoints) #
Returns: TableBuilder

Sets the height for the specified row in points.

Parameters

rowIndex System.Int32 requiredposition: 0
heightPoints System.Double requiredposition: 1
Rows 3 overloads
public TableBuilder Rows(IEnumerable<KeyValuePair<String, String>> rows) #
Returns: TableBuilder

Adds multiple rows from a sequence of string lists (Markdown parity helper).

Parameters

rows System.Collections.Generic.IEnumerable{System.Collections.Generic.IReadOnlyList{System.String}} requiredposition: 0
Rows(System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.String}} rows) #

Adds two-column rows from tuples (Markdown parity helper).

Parameters

rows System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.String}} required
Rows(System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.String}} rows) #

Adds two-column rows from key/value pairs (Markdown parity helper).

Parameters

rows System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.String}} required
public TableBuilder RowStyle(Int32 index, Action<WordTableRow> action) #
Returns: TableBuilder

Applies an action to a specified row.

Parameters

index System.Int32 requiredposition: 0
action System.Action{OfficeIMO.Word.WordTableRow} requiredposition: 1
public TableBuilder Style(WordTableStyle style) #
Returns: TableBuilder

Applies a built-in table style.

Parameters

style OfficeIMO.Word.WordTableStyle requiredposition: 0

Properties

public WordTable Table { get; } #

Gets the table being built.