Open GoogleCodeExporter opened 8 years ago
Hi there, sorry for the slow response.
Your step 2, table.header(['\033[34mxyz\033[0m']), is not a valid use of the
PrettyTable API. The header attribute is a boolean flag, not a callable
function.
I assume you meant maybe something like table.field_names =
['\033[34mxyz\033[0m'], i.e. you want one of the field names to be in colour.
I can't replicate your problem, I've included ANSI color codes in a field name
and the alignment continues to work as expected.
Could you please paste some valid code which runs and demonstrates your issue?
Thank you for the report.
Original comment by luke@maurits.id.au
on 5 Oct 2013 at 10:26
I'm also having the same problem here except it only happens over ssh. If I run
my program locally the formatting is just fine.
Original comment by creiganw...@gmail.com
on 22 Feb 2014 at 11:58
This shall reproduce it. I think the issue 54 I opened is related to this one:
#!/usr/bin/python
from prettytable import PrettyTable
x = PrettyTable(["City name", "Area", "Population", "Annual Rainfall"])
x.align["City name"] = "l" # Left align city names
x.padding_width = 1 # One space between column edges and contents (default)
x.add_row(["Adelaide",1295, 1158259, 600.5])
x.add_row(["Brisbane",5905, 1857594, "\033[94m1146.4\033[0m"])
x.add_row(["Darwin", 112, 120900, 1714.7])
x.add_row(["Hobart", 1357, 205556, 619.5])
x.add_row(["Sydney", 2058, 4336374, 1214.8])
x.add_row(["Melbourne", 1566, 3806092, 646.9])
x.add_row(["Perth", 5386, 1554769, 869.4])
print x
Original comment by obaidmus...@gmail.com
on 6 Jun 2014 at 10:50
Original issue reported on code.google.com by
SShagin...@gmail.com
on 21 Aug 2013 at 4:26