Skip to content

Releases: BrunoVT1992/ConsoleTable

Release v2.1.0

15 Jan 22:29
2691548

Choose a tag to compare

V2.1.0

New Properties

Property Type Default Description
ShowBorders bool true When false, the table is drawn without borders for a more minimalist style
using ConsoleTable.Text;

// Setup the table
var table = new Table
{
    ShowBorders = false
};

// Set headers
table.SetHeaders("Name", "Age", "City");

// Add rows
table.AddRow("Alice Cooper", "30", "New York");
table.AddRows(new string[][]
{
    new string[] { "Bob", "25", "Los Angeles" },
    new string[] { "Charlie Brown", "47", "Chicago" }
});

// Set footers
table.SetFooters("Total: 3", "Total Age: 102");

// Display the table
Console.WriteLine(table.ToTable());

Output:

 Name            Age              City
 Alice Cooper    30               New York
 Bob             25               Los Angeles
 Charlie Brown   47               Chicago
 Total: 3        Total Age: 102

Release v2.0.0

09 Dec 10:59
d839a47

Choose a tag to compare

V2.0.0

New Properties

Property Type Default Description
Footers string[] Array.Empty<string>() The table footers. Footers are not required.
FooterTextAlignmentRight bool false When true, footer text is right-aligned otherwise left aligned

New Method

Method Description
SetFooters(params string[] footers) Sets the table footers. Calling this again will overwrite previous footers. Footers are not required.

New Styling

  • Headers now have a double bottom line to seperate them from the rows.
  • Now an option to add footers to the table (optional). These are drawn without borders at the bottom.
  • Footer text can be left or right aligned.
using ConsoleTable.Text;

// Setup the table
var table = new Table();

// Set headers
table.SetHeaders("Name", "Age", "City");

// Add rows
table.AddRow("Alice Cooper", "30", "New York");

table.AddRows(new string[][]
{
    new string[] { "Bob", "25", "Los Angeles" },
    new string[] { "Charlie Brown", "47", "Chicago" }
});

//Set footers
table.SetFooters("Total: 3", "Total Age: 102");

// Display the table
Console.WriteLine(table.ToTable());

Output:

┌───────────────┬────────────────┬─────────────┐
│ Name          │ Age            │ City        │
├═══════════════┼════════════════┼═════════════┤
│ Alice Cooper  │ 30             │ New York    │
├───────────────┼────────────────┼─────────────┤
│ Bob           │ 25             │ Los Angeles │
├───────────────┼────────────────┼─────────────┤
│ Charlie Brown │ 47             │ Chicago     │
└───────────────┴────────────────┴─────────────┘
  Total: 3        Total Age: 102

Performance Improvements

  • Slightly improved performance when rendering large tables with many rows and columns.

Release v1.0.3

08 Dec 09:57
c1d2c5e

Choose a tag to compare

V1.0.3

New Property

Property Type Default Description
CachingEnabled bool true When true, the generated table string is cached when the ToTable method is called. Cache will be cleared on any property change or method call.

New Method

Method Description
ClearCache() Clears the cached generated table string.

Release v1.0.2

07 Dec 19:24
171229e

Choose a tag to compare

V1.0.2

New Properties

Property Type Default Description
Headers string[] Array.Empty<string>() The table headers. Headers are not required.
Rows List<string[]> new List<string[]>() All the data rows for the table. Rows are not required.

New Method

Method Description
AddRows(params string[][] rows) Adds multiple data rows to the table. Rows are not required.

Release v1.0.1

30 Nov 10:35

Choose a tag to compare

V1.0.1

Add support for .net frameworks:

  • netstandard2.0
  • netcoreapp3.1
  • net5.0
  • net6.0
  • net7.0
  • net8.0
  • net9.0
  • net10.0

Release v1.0.0

30 Nov 09:59

Choose a tag to compare

V1.0.0

Initial release.