Closed OlafvdSpek closed 2 years ago
It is documented in a docstring but not README:
min_table_width - minimum desired table width, in characters
max_table_width - maximum desired table width, in characters
It was added in https://github.com/jazzband/prettytable/commit/1001f0e94be2269ce02909f1428487882b2916e7 in 2013.
I'd welcome PRs to document them in README and to fix it for headers. It may be that min_table_width
doesn't handle headers either.
This is interesting as well:
t = PrettyTable()
t.max_table_width = 20
t.add_row([0, 1, 2, 3, 4, 5, 6])
print(len(t.get_string().split('\n')[0]))
print(t)
36
+----+----+----+----+----+----+----+
| Fi | Fi | Fi | Fi | Fi | Fi | Fi |
+----+----+----+----+----+----+----+
| 0 | 1 | 2 | 3 | 4 | 5 | 6 |
+----+----+----+----+----+----+----+
Noticed
max_table_width
in the code but didn't see it @ https://github.com/jazzband/prettytable/blob/master/README.md Is it undocumented?Headers don't appear to handle
max_table_width
properly.