astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.08k stars 162 forks source link

SEPARATING_LINE does not work with "outline" formats #322

Open GuidoBartoli opened 4 months ago

GuidoBartoli commented 4 months ago

The SEPARATING_LINE macro works only with the default style.

This is the sample data:

table = [
    ["A", 1, 2],
    ["B", 3, 4],
    SEPARATING_LINE,
    ["C", 5, 6],
    ["D", 7, 8],
]

Printing with the default style produces the correct output:

print(tabulate(table))

-  -  -
A  1  2
B  3  4
-  -  -
C  5  6
D  7  8
-  -  -

Using the outline format gives wrong output instead:

print(tabulate(table, tablefmt="outline"))

+---+---+---+
| A | 1 | 2 |
| B | 3 | 4 |
|  |
| C | 5 | 6 |
| D | 7 | 8 |
+---+---+---+
zellyn commented 3 months ago

It also doesn't work with html format. It seems to cause the table to end.