khalidabuhakmeh / ConsoleTables

Print out a nicely formatted table in a console application C#
MIT License
944 stars 157 forks source link

feature : draw a table from a dictionary<string,dictionary<string,object>> #61

Closed b3b00 closed 1 year ago

b3b00 commented 2 years ago

Hello,

This pull-request allows to display a table from a dictionary<string,dictionary<string,object>> where first level dictionary is a row and second level defines columns.

Dictionary<string, Dictionary<string, object>> data = new Dictionary<string, Dictionary<string, object>>()
            {
                {"A", new Dictionary<string, object>()
                {
                    { "A", true },
                    { "B", false },
                    { "C", true },
                }},
                {"B", new Dictionary<string, object>()
                {
                    { "A", false },
                    { "B", true },
                    { "C", false },
                }},
                {"C", new Dictionary<string, object>()
                {
                    { "A", false },
                    { "B", false },
                    { "C", true },
                }}
            };

will display :

A B C
A True False True
B False True False
C False False True

thanks for reviewing

khalidabuhakmeh commented 1 year ago

This will be in the next released version. Stay tuned and thank you.