Skip to content
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

SEPARATING_LINE doesn't work with grid table formats #328

Open
lingrlongr opened this issue Jun 10, 2024 · 1 comment
Open

SEPARATING_LINE doesn't work with grid table formats #328

lingrlongr opened this issue Jun 10, 2024 · 1 comment

Comments

@lingrlongr
Copy link

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
---  ---
@lingrlongr lingrlongr changed the title SEPARATING_LINE doesn't work with rounded_grid table format SEPARATING_LINE doesn't work with grid table formats Jun 10, 2024
@GuidoBartoli
Copy link

Take a look at #322, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants