python-tabulate
python-tabulate copied to clipboard
SEPARATING_LINE doesn't work with grid table formats
When using grid table formats to style a table, you get distorted results.
For example, this script:
import tabulate
rows = [
['foo', 'bar'],
['foo', 'bar'],
tabulate.SEPARATING_LINE,
['foo', 'bar'],
['foo', 'bar'],
]
print(tabulate.tabulate(rows, tablefmt='rounded_grid'))
When using rounded_grid, it renders:
╭─────┬─────╮
│ foo │ bar │
├─────┼─────┤
│ foo │ bar │
├─────┼─────┤
│ │
├─────┼─────┤
│ foo │ bar │
├─────┼─────┤
│ foo │ bar │
╰─────┴─────╯
When using grid, it renders:
+-----+-----+
| foo | bar |
+-----+-----+
| foo | bar |
+-----+-----+
| |
+-----+-----+
| foo | bar |
+-----+-----+
| foo | bar |
+-----+-----+
When using the default non-grid format, it renders:
--- ---
foo bar
foo bar
--- ---
foo bar
foo bar
--- ---
Take a look at #322, too.