Skip to content

Instantly share code, notes, and snippets.

@slawosz
Created July 30, 2013 19:01
Show Gist options
  • Save slawosz/6115816 to your computer and use it in GitHub Desktop.
Save slawosz/6115816 to your computer and use it in GitHub Desktop.
array = [['Number', 'Name'], [1, 'Foo'], [2, 'Bar'], [3, 'Baz']]
pretty_table(array)
# printed result:
+--------+--------+
| Number | Name |
+--------+--------+
| 1 | Foo |
+--------+--------+
| 2 | Bar |
+--------+--------+
| 3 | Baz |
+--------+--------+
@baisa
Copy link

baisa commented Aug 19, 2013

|Number|
|Name  |

|1     |
|Foo   |

|2     |
|Bar   |

|3     |
|Baz   |


or

-------
|Number|-------
|Name  |-------
|1     |-------
|Foo   |-------
|2     |-------
|Bar   |-------
|3     |-------

or

-------
|Number|-------
|Name  |
-------
|1     |-------
|Foo   |
-------
|2     |-------
|Bar   |
-------
|3     |-------
|Baz   |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment