Table<T>
ConsoleMonster.Widgets
A Table whose rows are read from typed items (Table.For): each column has a value selector, and every table option and fluent method applies as usual. Without columns, every public property of T is a column, read without reflection over anything else. The items are read when the table is first laid out and after Table<T>.Refresh. Table.For(servers) .Title("Servers") .Column(s => s.Name, c => c.Key()) .Column(s => s.Ram, c => c.Presenter(CellPresenters.Bytes)) .Totals();
Inheritance
- Table
- Table<T>
Derived Types
Usage
Explore 28 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.
Returned or exposed by 19
- Method Ui.Table
- Method Ui.Table``1
- Method ConsoleView.BuildTable
- Property LiveTable.Table
- Property RoleTable.Table
- Method Table.Column
- Method Table.Footer
- Method Table.For``1
- Method Table.Group
- Method Table.PlainRow
- Method Table.Row
- Method Table.Values
- Method Table<T>.Column
- Method Table<T>.Footer
- Method Table<T>.Group
- Method Table<T>.PlainRow
- Method Table<T>.Refresh
- Method Table<T>.Row
- Method Table<T>.Values
Accepted by parameters 9
- Method ContentBuilder.Table
- Method ContentBuilder.Table
- Method ContentBuilder.Table``1
- Method Ui.Table
- Constructor LiveTable.LiveTable
- Extension method LiveTable.Table
- Method LiveTableFluent.Table
- Extension method RoleTable.Table
- Method RoleTableFluent.Table
Type Parameters
- T
- The item type.
Methods
public Table<T?> Column(Func<T?, object?> value, Action<TableColumn>? configure = null, string? expression = null) #Adds a column read from each item. The header comes from the expression (s => s.Name is "Name", s => s.Address.City is "City"); set another with c => c.Header("...").
Parameters
- value System.Func<T?, object?>
- Reads the value from an item.
- configure System.Action<ConsoleMonster.Widgets.TableColumn>? = null
- Configures the column (priority, presenter, overflow...), or null.
- expression string? = null
- Filled in by the compiler from value; leave it out.
public Table<T?> Column(string header, Func<T?, object?> value, Action<TableColumn>? configure = null) #Adds a column read from each item, with a header.
Parameters
- header string
- The header (markup).
- value System.Func<T?, object?>
- Reads the value from an item.
- configure System.Action<ConsoleMonster.Widgets.TableColumn>? = null
- Configures the column, or null.
public Table<T?> Refresh() #Reads the items again at the next layout (after the collection changed).
Inherited Methods
public bool DisplaysColumn(string name, int width, RenderContext context) #Parameters
- name string
- width int
- context RenderContext
Returns
boolpublic Size Measure(Constraints constraints, RenderContext context) #Parameters
- constraints Constraints
- context RenderContext
Returns
Sizepublic Table PlainRow(params string?[] values) #Parameters
- values string?[]
Returns
Tablepublic void Render(Region region, RenderContext context) #Parameters
- region Region
- context RenderContext