Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownTableBuilder

OfficeIMO.Markdown

Namespace
OfficeIMO.Markdown
Assembly
OfficeIMO.Markdown
Source revision
e163ccb36643 with working tree changes
Modifiers
sealed

Builder for pipe tables.

Inheritance

  • object
  • MarkdownTableBuilder

Usage

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

Accepted by parameters 3

Constructors

public MarkdownTableBuilder() #

Methods

public MarkdownTableBuilder Align(params MarkdownColumnAlignment[] alignments) #

Sets column alignments for the table header/columns.

Parameters

alignments OfficeIMO.Markdown.MarkdownColumnAlignment[] required
public MarkdownTableBuilder AlignAll(MarkdownColumnAlignment alignment) #

Sets a uniform alignment for all columns (applied to header + cells).

Parameters

alignment OfficeIMO.Markdown.MarkdownColumnAlignment required
public MarkdownTableBuilder AlignByHeaders(MarkdownColumnAlignment alignment, params string[] headerNames) #

Align columns by matching header names (case-insensitive).

Parameters

alignment OfficeIMO.Markdown.MarkdownColumnAlignment required
headerNames string[] required
public MarkdownTableBuilder AlignCenter(params int[] cols) #

Set center alignment on specified 0-based column indexes. If none provided, all columns.

Parameters

cols int[] required
public MarkdownTableBuilder AlignDatesCenter(double threshold = 0.6) #

Guess date-like columns and center-align them. Threshold is fraction of date-like values required (0..1).

Parameters

threshold double = 0.6 optional
public MarkdownTableBuilder AlignLeft(params int[] cols) #

Set left alignment on specified 0-based column indexes. If none provided, all columns.

Parameters

cols int[] required
public MarkdownTableBuilder AlignNone(params int[] cols) #

Remove alignment (default) on specified 0-based column indexes. If none provided, all columns.

Parameters

cols int[] required
public MarkdownTableBuilder AlignNumericRight(double threshold = 0.8) #

Guess numeric columns by sampling values and align them right. Threshold is fraction of numeric-like values required (0..1).

Parameters

threshold double = 0.8 optional
public MarkdownTableBuilder AlignRight(params int[] cols) #

Set right alignment on specified 0-based column indexes. If none provided, all columns.

Parameters

cols int[] required
Columns 2 overloads
public MarkdownTableBuilder Columns(Action<OfficeTableOptions> configure) #

Configures default column options for subsequent FromAny calls.

Parameters

configure System.Action<OfficeIMO.OfficeTableOptions> required
public MarkdownTableBuilder Columns(Func<string, string> headerTransform) #

Sets a simple header transform used for generating header text (e.g., prettifying PascalCase).

Parameters

headerTransform System.Func<string, string> required
FromAny 3 overloads
public MarkdownTableBuilder FromAny(object? data) #

Populates the table from an arbitrary object. If data is - a sequence of scalars → one-column table with a row per value, - a sequence of objects → headers from public readable properties and rows per item, - a dictionary → two columns Key/Value, - a POCO → two columns Property/Value.

Parameters

data object? required
public MarkdownTableBuilder FromAny(object? data, OfficeTableOptions? options) #

Populates the table from arbitrary data with options (include/exclude/order).

Parameters

data object? required
options OfficeIMO.OfficeTableOptions? required
public MarkdownTableBuilder FromAny(object? data, Action<OfficeTableOptions> configure) #

Populates the table from arbitrary data using an inline options configuration.

Parameters

data object? required
configure System.Action<OfficeIMO.OfficeTableOptions> required
public MarkdownTableBuilder FromObject<T>(T? data, OfficeTableOptions? options = null) #

Populates the table from a single object using public readable properties.

Type Parameters

T

Parameters

data T? required
options OfficeIMO.OfficeTableOptions? = null optional
public MarkdownTableBuilder FromSequenceAuto<T>(IEnumerable<T?> items, OfficeTableOptions? options = null) #

Populates the table from a sequence of objects using public readable properties.

Type Parameters

T

Parameters

items System.Collections.Generic.IEnumerable<T?> required
options OfficeIMO.OfficeTableOptions? = null optional
public MarkdownTableBuilder FromSequence<T>(IEnumerable<T?> items, params ValueTuple<string, Func<T?, object?>>[] columns) #

Populates the table from a sequence using explicit column selectors.

Type Parameters

T

Parameters

items System.Collections.Generic.IEnumerable<T?> required
columns System.ValueTuple<string, System.Func<T?, object?>>[] required
public MarkdownTableBuilder Headers(params string[] headers) #

Sets the header row.

Parameters

headers string[] required
public MarkdownTableBuilder Row(params string[] cells) #

Adds a data row.

Parameters

cells string[] required
Rows 3 overloads
public MarkdownTableBuilder Rows(IEnumerable<IReadOnlyList<string>> rows) #

Adds multiple rows.

Parameters

rows System.Collections.Generic.IEnumerable<System.Collections.Generic.IReadOnlyList<string>> required
public MarkdownTableBuilder Rows(IEnumerable<ValueTuple<string, string>> rows) #

Adds two-column rows from tuples.

Parameters

rows System.Collections.Generic.IEnumerable<System.ValueTuple<string, string>> required
public MarkdownTableBuilder Rows(IEnumerable<KeyValuePair<string, string>> rows) #

Adds two-column rows from key/value pairs.

Parameters

rows System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> required