CsConsoleFormat and ConsoleTable are two different libraries to output C# objects into a formatted table in the terminal. CsConsoleFormat is more complex than consoletable.
// using ConsoleTables;static void Main(String[] args){ var table = new ConsoleTable("one", "two", "three"); table.AddRow(1, 2, 3) .AddRow("this line should be longer", "yes it is", "oh"); table.Write(); Console.WriteLine(); var rows = Enumerable.Repeat(new Something(), 10); ConsoleTable .From<Something>(rows) .Configure(o => o.NumberAlignment = Alignment.Right) .Write(Format.Alternative); Console.ReadKey();}
// using ConsoleTables;static void Main(String[] args){ var table = new ConsoleTable("one", "two", "three"); table.AddRow(1, 2, 3) .AddRow("this line should be longer", "yes it is", "oh"); table.Write(); Console.WriteLine(); var rows = Enumerable.Repeat(new Something(), 10); ConsoleTable .From<Something>(rows) .Configure(o => o.NumberAlignment = Alignment.Right) .Write(Format.Alternative); Console.ReadKey();}
I don't really see where
CsConsoleFormat
CsConsoleFormat
takes in data and when it is printed. I also can't find any more documentation on this library. How would I uses CsConsoleFormat to print a list of class instances and some of their attributes?
Print out a nicely formatted table in a console application C# - GitHub - khalidabuhakmeh/ConsoleTables: Print out a nicely formatted table in a console application C#