diff --git a/.gitignore b/.gitignore index d46c576..10ee80d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ lib64/ *.zip docs/_build .coverage +.mypy_cache/ diff --git a/setup.py b/setup.py index 2160940..bab43c2 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.6.0', + version='0.6.1', description='Pretty console printing of tabular data', long_description='''Formatted console printing of tabular data. diff --git a/tableprint.py b/tableprint.py index b907453..5870e53 100644 --- a/tableprint.py +++ b/tableprint.py @@ -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)