Fixes ANSI escape in headers

This commit is contained in:
Niru Maheswaranathan
2017-05-18 01:23:23 -07:00
parent 69fea15bd2
commit cb7c1d27f4
3 changed files with 3 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ def header(headers, width=WIDTH, style=STYLE, add_hr=True):
tablestyle = styles[style]
# string formatter
data = map(lambda x: ('{:^%d}' % width).format(x), headers)
data = map(lambda x: ('{:^%d}' % (width + _ansi_len(x))).format(x), headers)
# build the formatted str
headerstr = _format_line(data, tablestyle.row)