Skip to content
ConsoleMonster
Class

TableFluent

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
static

The fluent methods of Table: the generated property methods and the handwritten table helpers.

Inheritance

  • object
  • TableFluent

Methods

public static TSelf AlwaysCards<TSelf>(TSelf table, bool value = true) #

Sets Table.AlwaysCards: Shows the rows as record cards at any width (the Cards view of Show-Console).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Widgets.Table { AlwaysCards = value };    Ui.Table().AlwaysCards(value);
public static TSelf AutoTotals<TSelf>(TSelf table, bool value = true) #

Sets Table.AutoTotals: With Table.ShowTotals, also sums every column whose values are all numbers (not the key column and not identifier columns such as Id or Port) when it has no TableColumn.Aggregate of its own.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Table { AutoTotals = value };    Ui.Table().AutoTotals(value);
public static TSelf Border<TSelf>(TSelf table, TableBorder value) #

Sets Table.Border: The border style (default rounded).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value ConsoleMonster.Widgets.TableBorder required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                   // C# fluent
new global::ConsoleMonster.Widgets.Table { Border = value };    Ui.Table().Border(value);
public static TSelf Caption<TSelf>(TSelf table, string? value) #

Sets Table.Caption: A caption shown below the table (markup, muted).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value string? required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ConsoleMonster.Widgets.Table { Caption = value };    Ui.Table().Caption(value);
public static TSelf CardsBelow<TSelf>(TSelf table, int value) #

Sets Table.CardsBelow: Below this many cells of width the rows render as record cards (key column as the card title); 0 disables cards. Default 60. Cards are used only when the grid cannot fit its minimum widths; they also take over when hiding columns would leave only the key column.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Table { CardsBelow = value };    Ui.Table().CardsBelow(value);
public static TSelf Column<TSelf>(TSelf table, string header, Action<TableColumn> configure) #

Adds a column with a header and an optional configuration.

Type Parameters

TSelf
The table type.

Parameters

table TSelf required
The table.
header string required
The header (markup).
configure System.Action<ConsoleMonster.Widgets.TableColumn> required
Configures the column (priority, presenter, overflow...), or null.

Returns

TSelf The same table.
public static TSelf Expand<TSelf>(TSelf table, bool value = true) #

Sets Table.Expand: Whether the table fills the available width: the free-text columns share the spare width in proportion to their widths, unless columns set TableColumn.Weight or TableColumn.Flexible; number, date and status columns keep their natural width.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                   // C# fluent
new global::ConsoleMonster.Widgets.Table { Expand = value };    Ui.Table().Expand(value);
public static TSelf GroupGap<TSelf>(TSelf table, int value) #

Sets Table.GroupGap: Blank lines before each group after the first (default zero).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                     // C# fluent
new global::ConsoleMonster.Widgets.Table { GroupGap = value };    Ui.Table().GroupGap(value);
public static TSelf GroupHeadersAsRows<TSelf>(TSelf table, bool value = true) #

Sets Table.GroupHeadersAsRows: Whether group labels occupy full-width section rows instead of labelled border rules (default false).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                               // C# fluent
new global::ConsoleMonster.Widgets.Table { GroupHeadersAsRows = value };    Ui.Table().GroupHeadersAsRows(value);
public static TSelf HeaderSeparator<TSelf>(TSelf table, bool value = true) #

Sets Table.HeaderSeparator: Whether a separator row is drawn under the header (default true). When false the header is underlined instead, so data starts on the row directly below it.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.Table { HeaderSeparator = value };    Ui.Table().HeaderSeparator(value);
public static TSelf KeepAllColumns<TSelf>(TSelf table, bool value = true) #

Sets Table.KeepAllColumns: Keep all columns by rendering consecutive grids with the key repeated when the full grid cannot fit.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Widgets.Table { KeepAllColumns = value };    Ui.Table().KeepAllColumns(value);
public static TSelf MaxRows<TSelf>(TSelf table, int value) #

Sets Table.MaxRows: Shows only the first N rows (0 = all) followed by Showing N of M; totals still cover every row.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ConsoleMonster.Widgets.Table { MaxRows = value };    Ui.Table().MaxRows(value);
Presentation``1 2 overloads
public static TSelf Presentation<TSelf>(TSelf table, PresentationOptions value) #

Sets Table.Presentation: Culture, clock and time zone for raw values.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value ConsoleMonster.Presenters.PresentationOptions required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.Table { Presentation = value };    Ui.Table().Presentation(value);
public static TSelf Presentation<TSelf>(TSelf table, Action<PresentationOptions> configure) #

Configures Table.Presentation in place (creating it when not set): Culture, clock and time zone for raw values.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
configure System.Action<ConsoleMonster.Presenters.PresentationOptions> required
Configures the value.

Returns

TSelf The same instance.
public static TSelf RecordViewRows<TSelf>(TSelf table, int value) #

Sets Table.RecordViewRows: A table with at most this many rows renders as a record view (default 1; 0 disables).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Widgets.Table { RecordViewRows = value };    Ui.Table().RecordViewRows(value);
public static TSelf RowTitles<TSelf>(TSelf table, IEnumerable<string?> items) #

Adds items to Table.RowTitles: Titles for the rows in record and card views, by data row index (a null or empty entry uses the key column), so a caller can title a record "pwsh (90836)" while the key column stays the name. Null for none.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
items System.Collections.Generic.IEnumerable<string?> required
The items, in order.

Returns

TSelf The same instance.
public static TSelf RowTitle<TSelf>(TSelf table, string? item) #

Adds an item to Table.RowTitles: Titles for the rows in record and card views, by data row index (a null or empty entry uses the key column), so a caller can title a record "pwsh (90836)" while the key column stays the name. Null for none.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
item string? required
The item.

Returns

TSelf The same instance.
public static TSelf ShowCardCount<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowCardCount: Show the record count beneath cards (default true). Omitted-row notices remain visible when false.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                          // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowCardCount = value };    Ui.Table().ShowCardCount(value);
public static TSelf ShowGroupCounts<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowGroupCounts: Append automatic row counts to group headings (default true).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowGroupCounts = value };    Ui.Table().ShowGroupCounts(value);
public static TSelf ShowHeader<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowHeader: Whether the header row is shown (default true).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowHeader = value };    Ui.Table().ShowHeader(value);
public static TSelf ShowHiddenColumns<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowHiddenColumns: Whether a footer names the columns hidden for lack of width (default true).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                              // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowHiddenColumns = value };    Ui.Table().ShowHiddenColumns(value);
public static TSelf ShowKeyField<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowKeyField: Also show the complete key as a wrapped field in record/card layouts, where headings may be omitted or truncated. Default false.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowKeyField = value };    Ui.Table().ShowKeyField(value);
public static TSelf ShowSubtotals<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowSubtotals: Whether each group ends with a subtotal row for columns that have an TableColumn.Aggregate.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                          // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowSubtotals = value };    Ui.Table().ShowSubtotals(value);
public static TSelf ShowTotals<TSelf>(TSelf table, bool value = true) #

Sets Table.ShowTotals: Whether a totals row summarises all rows (columns with an TableColumn.Aggregate), unless a footer is set.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Table { ShowTotals = value };    Ui.Table().ShowTotals(value);
public static TSelf StableWidths<TSelf>(TSelf table, bool value = true) #

Sets Table.StableWidths: Whether column widths never shrink while the same table is re-rendered (live tables; default true), so columns do not jump as values change. Widths still fit the available space.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.Table { StableWidths = value };    Ui.Table().StableWidths(value);
public static TSelf TitleIndent<TSelf>(TSelf table, int? value) #

Sets Table.TitleIndent: Optional grid-title indentation in cells; null retains the border-aligned default. Record and card views retain their own title layout.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int? required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Widgets.Table { TitleIndent = value };    Ui.Table().TitleIndent(value);
public static TSelf Title<TSelf>(TSelf table, string? value) #

Sets Table.Title: A title shown above the table (markup).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value string? required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                  // C# fluent
new global::ConsoleMonster.Widgets.Table { Title = value };    Ui.Table().Title(value);
public static TSelf TotalLabel<TSelf>(TSelf table, string? value) #

Sets Table.TotalLabel: The label of the totals row, or null (default) for the built-in word (Total in English).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value string? required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Table { TotalLabel = value };    Ui.Table().TotalLabel(value);
public static TSelf TotalRowCount<TSelf>(TSelf table, int? value) #

Sets Table.TotalRowCount: The total number of records when the caller added only some of them (for example the first 50 of 1,234), so the footer can say Showing 50 of 1,234; null when every record was added.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int? required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                          // C# fluent
new global::ConsoleMonster.Widgets.Table { TotalRowCount = value };    Ui.Table().TotalRowCount(value);
public static TSelf Totals<TSelf>(TSelf table, string? label = null) #

Adds a totals row that sums every numeric column (Table.ShowTotals with Table.AutoTotals); columns with their own TableColumn.Aggregate keep it.

Type Parameters

TSelf
The table type.

Parameters

table TSelf required
The table.
label string? = null optional
The label of the totals row, or null for the built-in word.

Returns

TSelf The same table.
public static TSelf WrapHeaders<TSelf>(TSelf table, bool value = true) #

Sets Table.WrapHeaders: Wrap column headings instead of shortening them (default false).

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Widgets.Table { WrapHeaders = value };    Ui.Table().WrapHeaders(value);
public static TSelf WrapLines<TSelf>(TSelf table, int value) #

Sets Table.WrapLines: The most lines a wrapped value uses when its column sets no TableColumn.MaxLines (default 3; 0 = no limit): a long description stays a few lines with an ellipsis instead of taking the screen.

Type Parameters

TSelf

Parameters

table TSelf required
The instance.
value int required
The value.

Returns

TSelf The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ConsoleMonster.Widgets.Table { WrapLines = value };    Ui.Table().WrapLines(value);