Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.Text.TextTable

Summary

Produces a table in a fixed-width character environment.

Constructors

Creates a new instance of TextTable.

Instance methods

void
AddCell(ConsoleColoredString content, int colSpan = 1, int rowSpan = 1, bool noWrap = false, HorizontalTextAlignment? alignment = null, ConsoleColor? background = null)
Places content at (TextTable.CurCol, TextTable.CurRow) and advances TextTable.CurCol by colSpan. See also TextTable.FinishRow().
void
AddRow(params string[] values)
Adds a new row to the end of the table, using default cell settings for each cell.
void
AddRow(params ConsoleColoredString[] values)
voidEnds the row that was being added to by TextTable.AddCell(ConsoleColoredString, int, int, bool, HorizontalTextAlignment?, ConsoleColor?) and begins the next row at column 0.
void
FinishRow(ConsoleColor? backgroundColor)
voidRemoves columns that contain only empty cells. Subsequent columns are moved to the left accordingly.
void
SetCell(int col, int row, string content, int colSpan = 1, int rowSpan = 1, bool noWrap = false, HorizontalTextAlignment? alignment = null, ConsoleColor? background = null)
Places the specified content into the cell at the specified co-ordinates.
void
SetCell(int col, int row, ConsoleColoredString content, int colSpan = 1, int rowSpan = 1, bool noWrap = false, HorizontalTextAlignment? alignment = null, ConsoleColor? background = null)
void
SetRowBackground(int row, ConsoleColor? backgroundColor)
Sets a background color for an entire row within the table, including the vertical rules if TextTable.VerticalRules is true. Background colors for individual cells take precedence within the bounds of that cell. Background colors in the input string take precendence for those characters.
ConsoleColoredString Generates the table.
string
  • Overrides: object.ToString()
voidOutputs the entire table to the console.

Instance properties

intGets or sets the number of characters to space each column apart from the next.
intGets or sets the index of the column used by the next call to TextTable.AddCell(ConsoleColoredString, int, int, bool, HorizontalTextAlignment?, ConsoleColor?).
intGets or sets the index of the row used by the next call to TextTable.AddCell(ConsoleColoredString, int, int, bool, HorizontalTextAlignment?, ConsoleColor?).
HorizontalTextAlignment Specifies the default alignment to use for cells where the alignment is not explicitly set. Default is HorizontalTextAlignment.Left.
int Gets or sets a value indicating the number of rows from the top that are considered table headers. The only effect of this is that the horizontal rule (if any) after the header rows is rendered using '=' characters instead of '-'.
bool Gets or sets a value indicating whether horizontal rules are rendered between rows. The horizontal rules are rendered only if TextTable.RowSpacing is greater than zero.
int Gets or sets a value indicating the number of spaces to add left of the table. This does not count towards the TextTable.MaxWidth.
int? Gets or sets the maximum width of the table, including all column spacing. If TextTable.UseFullWidth is false, the table may be narrower. If this is null, the table width depends on which method is used to generate it.
intGets or sets the number of characters to space each row apart from the next.
bool If true, the table will be expanded to fill the TextTable.MaxWidth. If false, the table will fill the whole width only if any cells need to be word-wrapped.
bool Gets or sets a value indicating whether vertical rules are rendered between columns. The vertical rules are rendered only if TextTable.ColumnSpacing is greater than zero.