Skip to content

mattermostbuilders TableMarkdownBuilder

BigMakCode edited this page Aug 5, 2024 · 1 revision

TableMarkdownBuilder Public class

Description

Table markdown builder.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph Mattermost.Builders
  Mattermost.Builders.TableMarkdownBuilder[[TableMarkdownBuilder]]
  end
Loading

Members

Methods

Public methods

Returns Name
TableMarkdownBuilder AddHeader(string``[] headers)
Add header to table.
TableMarkdownBuilder AddRow(...)
Add row to table.
string ToString()
Convert table to markdown string.

Details

Summary

Table markdown builder.

Constructors

TableMarkdownBuilder

public TableMarkdownBuilder(int columns, TableAlignment tableAlignment)
Arguments
Type Name Description
int columns Columns count.
TableAlignment tableAlignment Table alignment, default is center.
Summary

Create table builder.

Exceptions
Name Description
ArgumentOutOfRangeException If columns count is less than or equal to zero.

Methods

AddHeader

public TableMarkdownBuilder AddHeader(string[] headers)
Arguments
Type Name Description
string``[] headers Headers for columns.
Summary

Add header to table.

Returns

Current builder.

Exceptions
Name Description
ArgumentNullException If headers count is not equal to columns count.

AddRow [1/2]

public TableMarkdownBuilder AddRow(string[] cells)
Arguments
Type Name Description
string``[] cells Cells in row.
Summary

Add row to table.

Returns

Current builder.

Exceptions
Name Description
ArgumentNullException If cells count is not equal to columns count.
InvalidOperationException If table header is not added.

AddRow [2/2]

public TableMarkdownBuilder AddRow(object[] cells)
Arguments
Type Name Description
object``[] cells Cells in row.
Summary

Add row to table.

Returns

Current builder.

Exceptions
Name Description
ArgumentNullException If cells count is not equal to columns count.
InvalidOperationException If table header is not added.

ToString

public override string ToString()
Summary

Convert table to markdown string.

Returns

Markdown string.

Exceptions
Name Description
InvalidOperationException If table header is not added.

Generated with ModularDoc

Clone this wiki locally