Extra space at end of table #3591
Replies: 5 comments 3 replies
-
I'm not sure what you mean by "extra space", could you maybe show a screenshot? Running your example (with just the regular |
Beta Was this translation helpful? Give feedback.
-
I've attached an output file and a screen shot of a hex and character dump There should be no blanks (hex 20) following the vertical bar ┃ xE2 |
Beta Was this translation helpful? Give feedback.
-
Remove |
Beta Was this translation helpful? Give feedback.
-
It isn't about the appearance, it's about the length of the file, which
grows significantly due to the extra spaces appended to each line.
I have no idea why it is doing it.
…On Thu, Dec 19, 2024 at 8:26 PM TomJGooding ***@***.***> wrote:
Wasn't expecting a hex dump, I assumed you were talking about visual
spaces! 😆
—
Reply to this email directly, view it on GitHub
<#3591 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACP6BHIK675M2BWNT4MZEPL2GMMXHAVCNFSM6AAAAABT4KBJ2KVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRSGEYTONI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks.
…On Thu, Dec 19, 2024 at 10:28 PM TomJGooding ***@***.***> wrote:
https://rich.readthedocs.io/en/stable/console.html?highlight=justify#justify-alignment
—
Reply to this email directly, view it on GitHub
<#3591 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACP6BHOS2XPY5JDQHJ3J5DT2GM27VAVCNFSM6AAAAABT4KBJ2KVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRSGIZDCOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
When I print a table I get a large amount of
extra blanks at the end of each row. I've tried outputting to a
file, and also to the terminal (and redirecting output to a file)
How can I prevent this artifact?
I've tired various settings - show_edge, padding, collapse_padding, pad_edge,
but to no avail. Keeping the enclosing box doesn't avoid the padding either.
-- Code below ---
from rich import print
from rich.console import Console
from rich.logging import RichHandler
from rich.table import Table
console_sh = Console(file=open('Z.sh','w'))
RichHandler(console=console_sh)
tab = Table(show_lines=False, box=None)
""" An enclosing box doesn't avoid the problem either
tab = Table(show_lines=False)
"""
tab.add_column("GeoHash", style=None, no_wrap=True, justify="right")
tab.add_column("Count", style=None, no_wrap=True, justify="right")
tab.add_row( "9q8zpu", "1")
tab.add_row( "u6sc6", "2")
console_sh.print(tab, justify="left")
Beta Was this translation helpful? Give feedback.
All reactions