python-tabulate icon indicating copy to clipboard operation
python-tabulate copied to clipboard

SEPARATING_LINE feature doesn't work when the requested format pads columns

Open jeromegit opened this issue 3 years ago • 1 comments

Code to reproduce:

from tabulate import tabulate, SEPARATING_LINE

table = [["1", "one"],   # "1" as a str on purpose
         [1_000, "one K"],
         SEPARATING_LINE,
         [1_000_000, "one M"]]

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

Generates (note the weird 3rd line instead of an expected separating line)

+---------+-------+
|       1 | one   |
|    1000 | one K |
|  |
| 1000000 | one M |
+---------+-------+

Instead of the expected:

+---------+-------+
|       1 | one   |
|    1000 | one K |
|---------+-------|
| 1000000 | one M |
+---------+-------+

jeromegit avatar Dec 27 '22 01:12 jeromegit

@jeromegit Seems like #232 still doesn't work with any grid style formats

image

ilya112358 avatar Dec 27 '22 14:12 ilya112358