-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dividers don't render correctly at cell intersections with other styles #237
Comments
To be explicit, here's a reproducer that doesn't use the internal/private import prettytable
t = prettytable.PrettyTable()
t.set_style(prettytable.SINGLE_BORDER)
t.add_row([11,12,13,14])
t.add_row([21,22,23,24])
t.add_row([31,32,33,34], divider=True)
t.add_row([41,42,43,44])
print(t) Dividers were added in #185, and only tested with the default style. Here's the results with some other styles (https://github.com/jazzband/prettytable#setting-a-table-style).
|
Field 1 | Field 2 | Field 3 | Field 4 |
---|---|---|---|
11 | 12 | 13 | 14 |
21 | 22 | 23 | 24 |
31 | 32 | 33 | 34 |
:-------: | :-------: | :-------: | :-------: |
41 | 42 | 43 | 44 |
ORGMODE
Looks okay?
|---------+---------+---------+---------|
| Field 1 | Field 2 | Field 3 | Field 4 |
|---------+---------+---------+---------|
| 11 | 12 | 13 | 14 |
| 21 | 22 | 23 | 24 |
| 31 | 32 | 33 | 34 |
|---------+---------+---------+---------|
| 41 | 42 | 43 | 44 |
|---------+---------+---------+---------|
PLAIN_COLUMNS
Should maybe omit it here?
Field 1 Field 2 Field 3 Field 4
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
cc @myheroyuki
For plain column's I'd argue that is the expected behavior, because how else would you display a divider. Something like
might imply "null"-values in that row to some users instead of a separator and a "----------" bar would go against the plain columns style. In fact, one could argue, that a divider should look a little separate from the field separator, so it might be a feature, not a bug, but then it should be so across all styles. Not arguing for that, in fact, I'd vote against, just putting it out. |
this bug can be fixed, by changing one line in the main code (around line number 1781) |
This bug occurred when we are trying to add a divider and changing the style of it such as "Double border" and it will produce unexpected results.
What did you do?
Set a row divider using an alternate style and print the resulting table.
What did you expect to happen?
What actually happened?
Note the transition into the row below the 2nd divider. The whole 2nd divider should look like the first one (after the "fields" row).
What versions are you using?
The text was updated successfully, but these errors were encountered: