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
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
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.