Skip to content
A fluent library to print out a nicely formatted table in a console application C#
Branch: master
Clone or download
Latest commit e9e116a Jul 30, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Src update icon path Dec 25, 2018
wiki/Images update demo image Dec 1, 2017
.gitignore Add support for generic lists. Dec 24, 2018
ConsoleTableExtSolution.sln migrate to .net standard 2.0 Feb 13, 2018
LICENSE Initial commit Nov 23, 2017 Update Jul 30, 2019

ConsoleTableExt Build status

A library to print out a nicely formatted table in a console application C#


Install-Package ConsoleTableExt


How to use:

From [DataTable] type and Default format:


From [DataTable] type and Minimal format:


From [List] type and Alternative format:


From [List] type and MarkDown format w/ custom column name:

   .WithColumn(new List<string>{ "N A M E" , "[Position]", "Office", "<Age>", "Something else I don't care"})


var arrayBuilder = ConsoleTableBuilder.From(new List<object[]>
    new object[] {"luong", "son", "ba", null, "phim", null, null, null, 2, null},
    new object[] {"chuc", "anh", "dai", "nhac", null, null, null }

   .AddRow(new List<object> {1, "this", "is", "new", "row", "use", "<List>", null, null, null})
   .AddRow(new object[] {"2", "new row", "use", "array[] values", null, null})
   .WithOptions(new ConsoleTableBuilderOption
       MetaRowPosition = MetaRowPosition.Bottom,
       MetaRowFormat = "\n=> This table has {3} rows and {2} columns\n=> [{0}] - [test value {1}]",
       MetaRowParams = new object[]
           "test value 1",
       TrimColumn = true,
       Delimiter = "¡",
       DividerString = "»",
   .WithColumn(new List<string> {"THIS", "IS", "ADVANCED", "OPTIONS"})

Sample data:

static DataTable SampleTableData()
   DataTable table = new DataTable();
   table.Columns.Add("Name", typeof(string));
   table.Columns.Add("Position", typeof(string));
   table.Columns.Add("Office", typeof(string));
   table.Columns.Add("Age", typeof(int));
   table.Columns.Add("Start Date", typeof(DateTime));

   table.Rows.Add("Airi Satou", "Accountant", "Tokyo", 33, new DateTime(2017, 05, 09));
   table.Rows.Add("Angelica Ramos", "Chief Executive Officer (CEO)", "New York", 47, new DateTime(2017, 01, 12));
   table.Rows.Add("Ashton Cox", "Junior Technical Author", "London", 46, new DateTime(2017, 04, 02));
   table.Rows.Add("Bradley Greer", "Software Engineer", "San Francisco", 28, new DateTime(2017, 11, 15));

   return table;

static List<List<object>> SampleListData = new List<List<object>>
   new List<object>{ "Sakura Yamamoto", "Support Engineer", "London", 46},
   new List<object>{ "Serge Baldwin", "Data Coordinator", "San Francisco", 28, "something else" },
   new List<object>{ "Shad Decker", "Regional Director", "Edinburgh"},

Inspired by

You can’t perform that action at this time.