API Reference
TableBuilder (Fluent)
Builder for tables.
Inheritance
- Object
- TableBuilder
Methods
public TableBuilder Align(HorizontalAlignment alignment) #TableBuilderSets horizontal alignment for the table.
Parameters
- alignment OfficeIMO.HorizontalAlignment
public TableBuilder Cell(Int32 row, Int32 column, Action<WordTableCell> action) #TableBuilderPerforms an action on the specified cell using 1-based row and column indices.
Parameters
- row System.Int32
- column System.Int32
- action System.Action{OfficeIMO.Word.WordTableCell}
public TableBuilder CellStyle(Int32 row, Int32 column, Action<WordTableCell> action) #TableBuilderApplies an action to style a specific cell using 1-based coordinates.
Parameters
- row System.Int32
- column System.Int32
- action System.Action{OfficeIMO.Word.WordTableCell}
public TableBuilder Columns(Int32 columns) #TableBuilderSets the number of columns for the table.
Parameters
- columns System.Int32
public TableBuilder ColumnStyle(Int32 index, Action<WordTableCell> action) #TableBuilderApplies an action to each cell in a specified column.
Parameters
- index System.Int32
- action System.Action{OfficeIMO.Word.WordTableCell}
public TableBuilder ColumnWidth(Int32 columnIndex, Double widthPoints) #TableBuilderSets the width for the specified column in points.
Parameters
- columnIndex System.Int32
- widthPoints System.Double
public TableBuilder ColumnWidthsPercentage(params Int32[] percentages) #TableBuilderSets column widths using percentage values.
Parameters
- percentages System.Int32[]
public TableBuilder Create(Int32 rows, Int32 columns) #TableBuilderCreates the table with the specified size.
Parameters
- rows System.Int32
- Number of rows.
- columns System.Int32
- Number of columns.
Returns
The current TableBuilder.
public TableBuilder DeleteColumn(Int32 index) #TableBuilderDeletes the column at the specified 1-based index.
Parameters
- index System.Int32
public TableBuilder DeleteRow(Int32 index) #TableBuilderDeletes the row at the specified 1-based index.
Parameters
- index System.Int32
public TableBuilder ForEachCell(Action<Int32, Int32, WordTableCell> action) #TableBuilderPopulates all cells using the provided text factory.
Parameters
- textFactory System.Func{System.Int32,System.Int32,System.String}
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}
public TableBuilder From2D(Object[] data) #TableBuilderCreates the table from a two-dimensional array.
Parameters
- data System.Object[0:,0:]
public TableBuilder Header(params Object[] cells) #TableBuilderAdds a header row to the table.
Parameters
- cells System.Object[]
public TableBuilder HeaderRow(Int32 index) #TableBuilderMarks a specified row as the header row.
Parameters
- index System.Int32
public TableBuilder Headers(params String[] headers) #TableBuilderSets header cells using strings (Markdown parity helper).
Parameters
- headers System.String[]
public TableBuilder InsertColumn(Int32 index, params Object[] cells) #TableBuilderInserts a column at the specified 1-based index.
Parameters
- index System.Int32
- cells System.Object[]
public TableBuilder InsertRow(Int32 index, params Object[] cells) #TableBuilderInserts a row at the specified 1-based index.
Parameters
- index System.Int32
- cells System.Object[]
public TableBuilder Merge(Int32 fromRow, Int32 fromColumn, Int32 toRow, Int32 toColumn) #TableBuilderMerges a rectangular range of cells using 1-based coordinates.
Parameters
- fromRow System.Int32
- fromColumn System.Int32
- toRow System.Int32
- toColumn System.Int32
public TableBuilder PreferredWidth(Nullable<Int32> percent = null, Nullable<Int32> points = null) #TableBuilderSets the preferred width of the table.
Parameters
- percent System.Nullable{System.Int32} = null
- points System.Nullable{System.Int32} = null
public TableBuilder Row(params Object[] cells) #TableBuilderAdds a row to the table.
Parameters
- cells System.Object[]
public TableBuilder RowHeight(Int32 rowIndex, Double heightPoints) #TableBuilderSets the height for the specified row in points.
Parameters
- rowIndex System.Int32
- heightPoints System.Double
public TableBuilder Rows(IEnumerable<KeyValuePair<String, String>> rows) #TableBuilderAdds multiple rows from a sequence of string lists (Markdown parity helper).
Parameters
- rows System.Collections.Generic.IEnumerable{System.Collections.Generic.IReadOnlyList{System.String}}
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}}
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}}
public TableBuilder RowStyle(Int32 index, Action<WordTableRow> action) #TableBuilderApplies an action to a specified row.
Parameters
- index System.Int32
- action System.Action{OfficeIMO.Word.WordTableRow}
public TableBuilder Style(WordTableStyle style) #TableBuilderApplies a built-in table style.
Parameters
- style OfficeIMO.Word.WordTableStyle
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public WordTable Table { get; } #Gets the table being built.