nirum / tableprint

Pretty console printing :clipboard: of tabular data in python :snake:
https://tableprint.readthedocs.io/
MIT License
174 stars 16 forks source link

Feature request: Horizontal alignment #16

Closed cbf305 closed 5 years ago

cbf305 commented 5 years ago

This is a simple, lightweight, and awesome package and exactly what I needed to print some database data in my CLI app. Any chance you could add two parameters for horizontal alignment that takes a string for the alignment of the cell data, such as "left", "center", or "right"? Something like header_align and row_align?? As it is right now I have to pad all the strings to be the same length as the longest one otherwise the table is difficult to read.

Thanks so much!

nirum commented 5 years ago

Great suggestion! Fixed in #17. Functions now take an align keyword argument that is either "left", "center" or "right".

For example:

screen shot 2019-02-18 at 5 09 38 pm
cbf305 commented 5 years ago

Awesome, thank you!