You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
V2.2.0
Multi-line support
Cell content can contain newlines and the table will adjust row height accordingly, in headers, rows and footers.
Bug fix
Edge case drawing issues of cell borders miss alligned when having empty rows or empty cell content fixed
Performance improvements
usingConsoleTable.Text;// Setup the tablevartable=newTable{RowTextAlignmentRight=false,HeaderTextAlignmentRight=false,FooterTextAlignmentRight=false,Padding=2,Headers=newstring[]{"Name",$"Age{Environment.NewLine}&{Environment.NewLine}Birthyear","City"},Rows=newList<string[]>{newstring[]{"Alice Cooper",$"30{Environment.NewLine}1995","New York"},newstring[]{"Bob",$"25{Environment.NewLine}2000","Los Angeles"},newstring[]{"Charlie Brown",$"67{Environment.NewLine}1958","Chicago"},newstring[]{"Gloria",$"40{Environment.NewLine}1985",$"Chicago{Environment.NewLine}Originally from Bogota, Colombia"}},Footers=newstring[]{$"Total: 4{Environment.NewLine}3 Male - 1 Female","Total Age: 162"}};// Display the tableConsole.WriteLine(table.ToTable());
Output:
┌─────────────────────┬──────────────────┬────────────────────────────────────┐
│ Name │ Age │ City │
│ │ & │ │
│ │ Birthyear │ │
├═════════════════════┼══════════════════┼════════════════════════════════════┤
│ Alice Cooper │ 30 │ New York │
│ │ 1995 │ │
├─────────────────────┼──────────────────┼────────────────────────────────────┤
│ Bob │ 25 │ Los Angeles │
│ │ 2000 │ │
├─────────────────────┼──────────────────┼────────────────────────────────────┤
│ Charlie Brown │ 67 │ Chicago │
│ │ 1958 │ │
├─────────────────────┼──────────────────┼────────────────────────────────────┤
│ Gloria │ 40 │ Chicago │
│ │ 1985 │ Originally from Bogota, Colombia │
└─────────────────────┴──────────────────┴────────────────────────────────────┘
Total: 4 Total Age: 162
3 Male - 1 Female
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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
usingConsoleTable.Text;// Setup the tablevartable=newTable{ShowBorders=false};// Set headerstable.SetHeaders("Name","Age","City");// Add rowstable.AddRow("Alice Cooper","30","New York");table.AddRows(newstring[][]{newstring[]{"Bob","25","Los Angeles"},newstring[]{"Charlie Brown","47","Chicago"}});// Set footerstable.SetFooters("Total: 3","Total Age: 102");// Display the tableConsole.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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.
usingConsoleTable.Text;// Setup the tablevartable=newTable();// Set headerstable.SetHeaders("Name","Age","City");// Add rowstable.AddRow("Alice Cooper","30","New York");table.AddRows(newstring[][]{newstring[]{"Bob","25","Los Angeles"},newstring[]{"Charlie Brown","47","Chicago"}});//Set footerstable.SetFooters("Total: 3","Total Age: 102");// Display the tableConsole.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.