API Reference
TableFluent
The fluent methods of Table, generated from its public properties: With... sets a property and Add... adds to a collection, both returning the same instance.
Inheritance
- Object
- TableFluent
Methods
public static TSelf AddColumn<TSelf>(TSelf table, String header, Action<TableColumn> configure) #TSelfAdds a column with a header and an optional configuration.
Type Parameters
- TSelf
- The table type.
Parameters
- table TSelf
- The table.
- header System.String
- The header (markup).
- configure System.Action<ConsoleMonster.Widgets.TableColumn>
- Configures the column (priority, presenter, overflow...), or null.
Returns
The same table.
public static TSelf AddRowTitles<TSelf>(TSelf table, params String?[] items) #TSelfAdds 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
- The instance.
- items System.String?[]
- The items, in order.
Returns
The same instance.
public static TSelf AddRowTitles<TSelf>(TSelf table, IEnumerable<String?> items) #TSelfAdds 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
- The instance.
- items System.Collections.Generic.IEnumerable<System.String?>
- The items, in order.
Returns
The same instance.
public static TSelf AddRowTitle<TSelf>(TSelf table, String? item) #TSelfAdds 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
- The instance.
- item System.String?
- The item.
Returns
The same instance.
public static TSelf WithAlwaysCards<TSelf>(TSelf table, Boolean value = true) #TSelfSets Table.AlwaysCards: Shows the rows as record cards at any width (the Cards view of Show-Console).
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithAutoTotals<TSelf>(TSelf table, Boolean value = true) #TSelfSets 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
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithBorder<TSelf>(TSelf table, TableBorder value) #TSelfSets Table.Border: The border style (default rounded).
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value ConsoleMonster.Widgets.TableBorder
- The value.
Returns
The same instance.
public static TSelf WithCaption<TSelf>(TSelf table, String? value) #TSelfSets Table.Caption: A caption shown below the table (markup, muted).
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static TSelf WithCardsBelow<TSelf>(TSelf table, Int32 value) #TSelfSets 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
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static TSelf WithExpand<TSelf>(TSelf table, Boolean value = true) #TSelfSets Table.Expand: Whether the table fills the available width (spare width goes to the flexible column).
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithHeaderSeparator<TSelf>(TSelf table, Boolean value = true) #TSelfSets 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
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithMaxRows<TSelf>(TSelf table, Int32 value) #TSelfSets 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
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static TSelf WithPresentation<TSelf>(TSelf table, PresentationOptions value) #TSelfSets Table.Presentation: Culture, clock and time zone for raw values.
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value ConsoleMonster.Presenters.PresentationOptions
- The value.
Returns
The same instance.
public static TSelf WithPresentation<TSelf>(TSelf table, Action<PresentationOptions> configure) #TSelfConfigures Table.Presentation in place (creating it when not set): Culture, clock and time zone for raw values.
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- configure System.Action<ConsoleMonster.Presenters.PresentationOptions>
- Configures the value.
Returns
The same instance.
public static TSelf WithRecordViewRows<TSelf>(TSelf table, Int32 value) #TSelfSets 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
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static TSelf WithRowTitles<TSelf>(TSelf table, IList<String?>? value) #TSelfSets 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
- The instance.
- value System.Collections.Generic.IList<System.String?>?
- The value.
Returns
The same instance.
public static TSelf WithShowHeader<TSelf>(TSelf table, Boolean value = true) #TSelfSets Table.ShowHeader: Whether the header row is shown (default true).
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithShowSubtotals<TSelf>(TSelf table, Boolean value = true) #TSelfSets Table.ShowSubtotals: Whether each group ends with a subtotal row for columns that have an TableColumn.Aggregate.
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithShowTotals<TSelf>(TSelf table, Boolean value = true) #TSelfSets 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
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithStableWidths<TSelf>(TSelf table, Boolean value = true) #TSelfSets 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
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static TSelf WithTitle<TSelf>(TSelf table, String? value) #TSelfSets Table.Title: A title shown above the table (markup).
Type Parameters
- TSelf
Parameters
- table TSelf
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static TSelf WithTotalLabel<TSelf>(TSelf table, String? value) #TSelfSets 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
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static TSelf WithTotalRowCount<TSelf>(TSelf table, Int32? value) #TSelfSets 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
- The instance.
- value System.Int32?
- The value.
Returns
The same instance.
public static TSelf WithTotals<TSelf>(TSelf table, String? label = null) #TSelfAdds 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
- The table.
- label System.String? = null
- The label of the totals row, or null for the built-in word.
Returns
The same table.
public static TSelf WithWrapLines<TSelf>(TSelf table, Int32 value) #TSelfSets 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
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?