olekukonko / tablewriter

ASCII table in golang
MIT License
4.3k stars 368 forks source link

Request: Add functionality for converting Golang []map[string]string to table #98

Open emilojkovic opened 6 years ago

emilojkovic commented 6 years ago

Functionality for generating table from an array of identical map[string]string objects. For example, if the returned JSON had the structure:

[
  { "item1" : "value1",
    "item2" : "value2"
     ...
  },
  { "item1" : "value3",
    "item2" : "value4"
     ...
  },
  ...
]

I would like to generate a table: +--------+---------+ | item1 | item2 | +--------+---------+ | value1 | value2 | | value3 | value4 | +--------+---------+

emilojkovic commented 6 years ago

self-assigning! (already wrote the code for this, going to submit PR)

iamstoick commented 4 years ago

was the PR already submitted? I'd like to use this feature. Thank you

moluzhui commented 2 years ago

Hi, has this function been merged? I'd like to use this feature. Thank you

yasin-cs-ko-ak commented 1 year ago

I want opposite of this. Is it possible to convert this table into json? @moluzhui @emilojkovic