python-tabulate
python-tabulate copied to clipboard
Line breaks are stripped when maxcolwidths argument is used
When the maxcolwidths argument is used, explicit line breaks are stripped out and replaced with spaces:
>>> table = [("a\na", 1), ("b", 2)]
>>> print(tabulate(table, tablefmt="grid"))
+---+---+
| a | 1 |
| a | |
+---+---+
| b | 2 |
+---+---+
>>> print(tabulate(table, tablefmt="grid", maxcolwidths=10))
+-----+---+
| a a | 1 |
+-----+---+
| b | 2 |
+-----+---+
>>>