Table of Contents

Class TableControlBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for creating TableControl instances with comprehensive configuration.

public sealed class TableControlBuilder
Inheritance
TableControlBuilder
Inherited Members

Methods

AddColumn(TableColumn)

Adds a custom column to the table.

public TableControlBuilder AddColumn(TableColumn column)

Parameters

column TableColumn

Returns

TableControlBuilder

AddColumn(string, Justify, int?)

Adds a column to the table.

public TableControlBuilder AddColumn(string header, Justify alignment = Justify.Left, int? width = null)

Parameters

header string
alignment Justify
width int?

Returns

TableControlBuilder

AddRow(TableRow)

Adds a custom row to the table.

public TableControlBuilder AddRow(TableRow row)

Parameters

row TableRow

Returns

TableControlBuilder

AddRow(params string[])

Adds a row with the specified cells.

public TableControlBuilder AddRow(params string[] cells)

Parameters

cells string[]

Returns

TableControlBuilder

AlignBottom()

Aligns the table to the bottom vertically.

public TableControlBuilder AlignBottom()

Returns

TableControlBuilder

Build()

Builds the TableControl with all configured options.

public TableControl Build()

Returns

TableControl

CenterHorizontal()

Centers the table horizontally.

public TableControlBuilder CenterHorizontal()

Returns

TableControlBuilder

CenterVertical()

Centers the table vertically.

public TableControlBuilder CenterVertical()

Returns

TableControlBuilder

Centered()

Centers the table horizontally and vertically.

public TableControlBuilder Centered()

Returns

TableControlBuilder

DoubleLine()

Uses double-line border style.

public TableControlBuilder DoubleLine()

Returns

TableControlBuilder

DoubleLineBorder()

Uses double-line border style.

public TableControlBuilder DoubleLineBorder()

Returns

TableControlBuilder

Hidden()

Hides the table.

public TableControlBuilder Hidden()

Returns

TableControlBuilder

HideHeader()

Hides the header row.

public TableControlBuilder HideHeader()

Returns

TableControlBuilder

NoBorder()

Uses no border.

public TableControlBuilder NoBorder()

Returns

TableControlBuilder

Rounded()

Uses rounded border style.

public TableControlBuilder Rounded()

Returns

TableControlBuilder

ShowHeader(bool)

Shows or hides the header row.

public TableControlBuilder ShowHeader(bool show = true)

Parameters

show bool

Returns

TableControlBuilder

ShowRowSeparators(bool)

Shows or hides row separators.

public TableControlBuilder ShowRowSeparators(bool show = true)

Parameters

show bool

Returns

TableControlBuilder

SingleLine()

Uses single-line border style.

public TableControlBuilder SingleLine()

Returns

TableControlBuilder

StickyBottom()

Makes the table stick to the bottom during scrolling.

public TableControlBuilder StickyBottom()

Returns

TableControlBuilder

StickyTop()

Makes the table stick to the top during scrolling.

public TableControlBuilder StickyTop()

Returns

TableControlBuilder

StretchHorizontal()

Stretches the table horizontally to fill available width.

public TableControlBuilder StretchHorizontal()

Returns

TableControlBuilder

WithBackgroundColor(Color)

Sets the background color.

public TableControlBuilder WithBackgroundColor(Color color)

Parameters

color Color

Returns

TableControlBuilder

WithBorderColor(Color)

Sets the border color.

public TableControlBuilder WithBorderColor(Color color)

Parameters

color Color

Returns

TableControlBuilder

WithBorderStyle(BorderStyle)

Sets the border style.

public TableControlBuilder WithBorderStyle(BorderStyle style)

Parameters

style BorderStyle

Returns

TableControlBuilder

WithColors(Color, Color)

Sets both foreground and background colors.

public TableControlBuilder WithColors(Color foreground, Color background)

Parameters

foreground Color
background Color

Returns

TableControlBuilder

WithColumns(params string[])

Adds multiple columns from header names.

public TableControlBuilder WithColumns(params string[] headers)

Parameters

headers string[]

Returns

TableControlBuilder

WithForegroundColor(Color)

Sets the foreground (text) color.

public TableControlBuilder WithForegroundColor(Color color)

Parameters

color Color

Returns

TableControlBuilder

WithHeaderColors(Color, Color)

Sets the header colors.

public TableControlBuilder WithHeaderColors(Color foreground, Color background)

Parameters

foreground Color
background Color

Returns

TableControlBuilder

WithHeight(int)

Sets the explicit height.

public TableControlBuilder WithHeight(int height)

Parameters

height int

Returns

TableControlBuilder

WithHorizontalAlignment(HorizontalAlignment)

Sets the horizontal alignment.

public TableControlBuilder WithHorizontalAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

Returns

TableControlBuilder

WithMargin(int)

Sets the margin around the table.

public TableControlBuilder WithMargin(int margin)

Parameters

margin int

Returns

TableControlBuilder

WithMargin(int, int)

Sets the margin with separate horizontal and vertical values.

public TableControlBuilder WithMargin(int horizontal, int vertical)

Parameters

horizontal int
vertical int

Returns

TableControlBuilder

WithMargin(int, int, int, int)

Sets the margin with individual values.

public TableControlBuilder WithMargin(int left, int top, int right, int bottom)

Parameters

left int
top int
right int
bottom int

Returns

TableControlBuilder

WithName(string)

Sets the control name for lookup.

public TableControlBuilder WithName(string name)

Parameters

name string

Returns

TableControlBuilder

WithRows(IEnumerable<TableRow>)

Adds multiple rows to the table.

public TableControlBuilder WithRows(IEnumerable<TableRow> rows)

Parameters

rows IEnumerable<TableRow>

Returns

TableControlBuilder

WithSafeBorder(bool)

Enables safe border characters for compatibility.

public TableControlBuilder WithSafeBorder(bool useSafe = true)

Parameters

useSafe bool

Returns

TableControlBuilder

WithStickyPosition(StickyPosition)

Sets the sticky position.

public TableControlBuilder WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

Returns

TableControlBuilder

WithTag(object)

Sets the tag for custom data.

public TableControlBuilder WithTag(object tag)

Parameters

tag object

Returns

TableControlBuilder

WithTitle(string, Justify)

Sets the table title.

public TableControlBuilder WithTitle(string title, Justify alignment = Justify.Center)

Parameters

title string
alignment Justify

Returns

TableControlBuilder

WithVerticalAlignment(VerticalAlignment)

Sets the vertical alignment.

public TableControlBuilder WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

Returns

TableControlBuilder

WithVisibility(bool)

Sets the visibility.

public TableControlBuilder WithVisibility(bool visible)

Parameters

visible bool

Returns

TableControlBuilder

WithWidth(int)

Sets the explicit width.

public TableControlBuilder WithWidth(int width)

Parameters

width int

Returns

TableControlBuilder

Operators

implicit operator TableControl(TableControlBuilder)

Implicit conversion to TableControl.

public static implicit operator TableControl(TableControlBuilder builder)

Parameters

builder TableControlBuilder

Returns

TableControl