Am I missing something in the max_width that prevents it from wrapping headers as well?
Also, should max_table_width wrap the title?
I also noticed that the max_width for column '1' is 20 in both tables, but in the 2 tables the wrapping for that column is not the same. Is that intended?
I'm trying to setup constraints that will keep the entire table within 100 characters wide and will accommodate any title/header/data length.
I had assumed that PrettyTable would handle this automagically after I set the min/max widths.
I'm not getting what I expected from the header, and I am extrapolating about the title and max_table_width.
This is all the debug logic to try and set the widths correctly
This is what I got:
+-----------------------------------------------------------------------------------------------------------------------------+
| A REALLLLLLLLY LOOOOOOOOOOOOOOOOOOOOOONG title for funsies, that SHOULD determine the max width........................... |
+-------------------------------------------+---------------------+-------------------+-------------------+-------------------+
| a very long header that SHOULD be wrapped | 1 | 2 | 3 | 4 |
+-------------------------------------------+---------------------+-------------------+-------------------+-------------------+
| 0 | a very long value | 2 | 3 | 4 |
| | that SHOULD be | | | |
| | wrapped. | | | |
+-------------------------------------------+---------------------+-------------------+-------------------+-------------------+
This is what I wanted:
+--------------------+---------------------+-------------------+-------------------+-------------------+
| A REALLLLLLLLY LOOOOOOOOOOOOOOOOOOOOOONG title for funsies, that SHOULD determine the max width |
| ........................... |
+--------------------+---------------------+-------------------+-------------------+-------------------+
| a very long header | 1 | 2 | 3 | 4 |
| that SHOULD be | | | | |
| wrapped | | | | |
+--------------------+---------------------+-------------------+-------------------+-------------------+
| 0 | a very long value | 2 | 3 | 4 |
| | that SHOULD be | | | |
| | wrapped. | | | |
+--------------------+---------------------+-------------------+-------------------+-------------------+
For clarification, I don't care how this title is wrapped, as long as it adapts to the constraints...
Am I missing something in the max_width that prevents it from wrapping headers as well?
Also, should max_table_width wrap the title?
I also noticed that the max_width for column '1' is 20 in both tables, but in the 2 tables the wrapping for that column is not the same. Is that intended?
I'm trying to setup constraints that will keep the entire table within 100 characters wide and will accommodate any title/header/data length.
I had assumed that PrettyTable would handle this automagically after I set the min/max widths.
I'm not getting what I expected from the header, and I am extrapolating about the title and max_table_width.
This is all the debug logic to try and set the widths correctly
This is what I got:
This is what I wanted: