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

[BUG] table.add_section does not draw a line / appear to do anything #3285

Open
adamcunnington-mlg opened this issue Feb 23, 2024 · 1 comment

Comments

@adamcunnington-mlg
Copy link

  • [ x ] I've checked docs and closed issues for possible solutions.
  • [ x ] I can't find my issue in the FAQ.

Describe the bug
I'm not sure if this is expected or not but rich.table.Table(..., leading=1) (presumably any number) combined with rich.table.Table.add_section() causes the section to not render.

Minimal reproduction:

def test():
    from rich import table, console
    t = table.Table(title="Preset Lint Violations", title_justify="left", leading=1)
    t.add_column("Foo", style="magenta", no_wrap=True)
    t.add_column("Bar", style="cyan")
    t.add_row("Before Section", "Bar")
    t.add_row("Before Section", "Bar")
    t.add_section()
    t.add_row("After Section", "Bar")
    t.add_row("After Section", "Bar")
    console.Console().print(t)

test()

If I don't use leading=1, looks as expected:
image

If I do use it, it looks like this:
image

If this is expected behaviour, I think it's weird/bad/confusing. I expect leading=1 to effectively give me row padding but not to stop sections rendering.

Platform
I am using Windows Terminal + WSL running Ubuntu 22.04 so maybe it's that combination of tooling that's leading to a visual nuance?

Full details:
image
image

Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

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

No branches or pull requests

1 participant