Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PowerPointTable

OfficeIMO.PowerPoint

Namespace
OfficeIMO.PowerPoint
Assembly
OfficeIMO.PowerPoint
Source revision
0eef6a5756b9 with working tree changes

Represents a table on a slide.

Inheritance

Usage

Explore 19 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.

Methods

public PowerPointTableColumn AddColumn(int? index = null) #

Adds a new column to the table.

Parameters

index int? = null optional
Optional zero-based index where the column should be inserted. If omitted, column is appended.
public PowerPointTableColumn AddColumnFromTemplate(int templateColumnIndex, int? index = null, bool clearText = true) #

Adds a new column cloned from a template column.

Parameters

templateColumnIndex int required
index int? = null optional
clearText bool = true optional
public PowerPointTableRow AddRow(int? index = null) #

Adds a new row to the table.

Parameters

index int? = null optional
Optional zero-based index where the row should be inserted. If omitted, row is appended.
public PowerPointTableRow AddRowFromTemplate(int templateRowIndex, int? index = null, bool clearText = true) #

Adds a new row cloned from a template row.

Parameters

templateRowIndex int required
index int? = null optional
clearText bool = true optional
public PowerPointTable ApplyStyle(PowerPointTableStylePreset preset) #

Applies a style preset to the table.

Parameters

preset OfficeIMO.PowerPoint.PowerPointTableStylePreset required
public PowerPointTable ApplyStyleByName(string styleName, bool ignoreCase = true, bool? firstRow = null, bool? lastRow = null, bool? firstColumn = null, bool? lastColumn = null, bool? bandedRows = null, bool? bandedColumns = null) #

Applies a table style by name, with optional banding/heading toggles.

Parameters

styleName string required
ignoreCase bool = true optional
firstRow bool? = null optional
lastRow bool? = null optional
firstColumn bool? = null optional
lastColumn bool? = null optional
bandedRows bool? = null optional
bandedColumns bool? = null optional
ApplyToCells 2 overloads
public void ApplyToCells(Action<PowerPointTableCell> action) #

Applies an action to all cells in the table.

Parameters

action System.Action<OfficeIMO.PowerPoint.PowerPointTableCell> required
public void ApplyToCells(int startRow, int endRow, int startColumn, int endColumn, Action<PowerPointTableCell> action) #

Applies an action to a rectangular range of cells.

Parameters

startRow int required
endRow int required
startColumn int required
endColumn int required
action System.Action<OfficeIMO.PowerPoint.PowerPointTableCell> required
public void ApplyToColumn(int columnIndex, Action<PowerPointTableCell> action) #

Applies an action to a specific column.

Parameters

columnIndex int required
action System.Action<OfficeIMO.PowerPoint.PowerPointTableCell> required
public void ApplyToRow(int rowIndex, Action<PowerPointTableCell> action) #

Applies an action to a specific row.

Parameters

rowIndex int required
action System.Action<OfficeIMO.PowerPoint.PowerPointTableCell> required
public void Bind<T>(IEnumerable<T?> data, IEnumerable<PowerPointTableColumn<T?>> columns, bool includeHeaders = true, int startRow = 0, int startColumn = 0) #

Binds data to the table, expanding rows/columns as needed.

Type Parameters

T

Parameters

data System.Collections.Generic.IEnumerable<T?> required
columns System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointTableColumn<T?>> required
includeHeaders bool = true optional
startRow int = 0 optional
startColumn int = 0 optional
public void ClearCellBorders(PowerPointTableCellBorders borders) #

Clears borders for all cells.

Parameters

borders OfficeIMO.PowerPoint.PowerPointTableCellBorders required
public PowerPointTableCell GetCell(int row, int column) #

Retrieves a cell at the specified row and column index.

Parameters

row int required
Zero-based row index.
column int required
Zero-based column index.
public PowerPointTableColumn GetColumn(int columnIndex) #

Retrieves a column wrapper at the specified index.

Parameters

columnIndex int required
public OfficeLength GetColumnWidth(int columnIndex) #

Gets the width of a specific column as a physical length.

Parameters

columnIndex int required

Returns

OfficeLength
public PowerPointTableRow GetRow(int rowIndex) #

Retrieves a row wrapper at the specified index.

Parameters

rowIndex int required
public OfficeLength GetRowHeight(int rowIndex) #

Gets the height of a specific row as a physical length.

Parameters

rowIndex int required

Returns

OfficeLength
public void MergeCells(int startRow, int startColumn, int endRow, int endColumn, bool clearMergedContent = true) #

Merges a rectangular range of cells into the top-left cell.

Parameters

startRow int required
Zero-based start row.
startColumn int required
Zero-based start column.
endRow int required
Zero-based end row.
endColumn int required
Zero-based end column.
clearMergedContent bool = true optional
Whether to clear text from merged cells.
public void RemoveColumn(int index) #

Removes a column at the specified index.

Parameters

index int required
Zero-based index of the column to remove.
public void RemoveRow(int index) #

Removes a row at the specified index.

Parameters

index int required
Zero-based index of the row to remove.
SetCellAlignment 2 overloads
public PowerPointTable SetCellAlignment(PowerPointTextAlignment? horizontal, PowerPointTextVerticalAlignment? vertical) #

Sets cell alignment for all cells.

Parameters

horizontal OfficeIMO.PowerPoint.PowerPointTextAlignment? required
vertical OfficeIMO.PowerPoint.PowerPointTextVerticalAlignment? required
public PowerPointTable SetCellAlignment(PowerPointTextAlignment? horizontal, PowerPointTextVerticalAlignment? vertical, int startRow, int endRow, int startColumn, int endColumn) #

Sets cell alignment for a range of cells.

Parameters

horizontal OfficeIMO.PowerPoint.PowerPointTextAlignment? required
vertical OfficeIMO.PowerPoint.PowerPointTextVerticalAlignment? required
startRow int required
endRow int required
startColumn int required
endColumn int required
public void SetCellBorders(PowerPointTableCellBorders borders, OfficeColor color, OfficeLength? width = null, PowerPointLineDashStyle? dash = null) #

Applies borders to all cells, retaining the existing width or dash when omitted.

Parameters

borders OfficeIMO.PowerPoint.PowerPointTableCellBorders required
color OfficeIMO.OfficeColor required
width OfficeIMO.OfficeLength? = null optional
dash OfficeIMO.PowerPoint.PowerPointLineDashStyle? = null optional
SetCellPadding 2 overloads
public PowerPointTable SetCellPadding(OfficeLength? left, OfficeLength? top, OfficeLength? right, OfficeLength? bottom) #

Sets cell padding for all cells.

Parameters

left OfficeIMO.OfficeLength? required
top OfficeIMO.OfficeLength? required
right OfficeIMO.OfficeLength? required
bottom OfficeIMO.OfficeLength? required
public PowerPointTable SetCellPadding(OfficeLength? left, OfficeLength? top, OfficeLength? right, OfficeLength? bottom, int startRow, int endRow, int startColumn, int endColumn) #

Sets cell padding for a range of cells.

Parameters

left OfficeIMO.OfficeLength? required
top OfficeIMO.OfficeLength? required
right OfficeIMO.OfficeLength? required
bottom OfficeIMO.OfficeLength? required
startRow int required
endRow int required
startColumn int required
endColumn int required
public PowerPointTable SetColumnWidth(int columnIndex, OfficeLength width) #

Sets the width of a specific column as a physical length.

Parameters

columnIndex int required
width OfficeIMO.OfficeLength required
public PowerPointTable SetColumnWidths(params OfficeLength[] widths) #

Sets physical sizes for the first rows or columns supplied.

Parameters

widths OfficeIMO.OfficeLength[] required
public PowerPointTable SetColumnWidthsByRatio(params double[] ratios) #

Sets column widths proportionally using ratios.

Parameters

ratios double[] required
public PowerPointTable SetColumnWidthsEvenly() #

Sets column widths evenly across the table width.

public PowerPointTable SetRowHeight(int rowIndex, OfficeLength height) #

Sets the height of a specific row as a physical length.

Parameters

rowIndex int required
height OfficeIMO.OfficeLength required
public PowerPointTable SetRowHeights(params OfficeLength[] heights) #

Sets physical sizes for the first rows or columns supplied.

Parameters

heights OfficeIMO.OfficeLength[] required
public PowerPointTable SetRowHeightsByRatio(params double[] ratios) #

Sets row heights proportionally using ratios.

Parameters

ratios double[] required
public PowerPointTable SetRowHeightsEvenly() #

Sets row heights evenly across the table height.

public bool TryApplyStyleByName(string styleName, bool ignoreCase = true, bool? firstRow = null, bool? lastRow = null, bool? firstColumn = null, bool? lastColumn = null, bool? bandedRows = null, bool? bandedColumns = null) #

Tries to apply a table style by name. Returns false if the style is not found.

Parameters

styleName string required
ignoreCase bool = true optional
firstRow bool? = null optional
lastRow bool? = null optional
firstColumn bool? = null optional
lastColumn bool? = null optional
bandedRows bool? = null optional
bandedColumns bool? = null optional

Returns

bool

Properties

public int RowCount { get; } #

Returns number of rows in the table.

public int ColumnCount { get; } #

Returns number of columns in the table.

public IReadOnlyList<PowerPointTableRow> Rows { get; } #

Row wrappers for the table.

public IReadOnlyList<PowerPointTableColumn> Columns { get; } #

Column wrappers for the table.

public bool HeaderRow { get; set; } #

Enables or disables header row styling (firstRow attribute) on the table.

public bool FirstRow { get; set; } #

Enables or disables first row styling on the table.

public bool LastRow { get; set; } #

Enables or disables last row styling on the table.

public bool FirstColumn { get; set; } #

Enables or disables first column styling on the table.

public bool LastColumn { get; set; } #

Enables or disables last column styling on the table.

public bool BandedRows { get; set; } #

Enables or disables banded rows styling (bandRow attribute) on the table.

public bool BandedColumns { get; set; } #

Enables or disables banded columns styling (bandCol attribute) on the table.

public string? StyleId { get; set; } #

Gets or sets the table style ID GUID.