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

justify="center" doesn't work on tables. #117

Closed
Secozzi opened this issue Jun 23, 2020 · 1 comment · Fixed by #118
Closed

justify="center" doesn't work on tables. #117

Secozzi opened this issue Jun 23, 2020 · 1 comment · Fixed by #118
Labels
bug Something isn't working

Comments

@Secozzi
Copy link

Secozzi commented Jun 23, 2020

As the title suggests, rich is unable to properly align a table with justify="center".
center_table
The code used:

from rich.console import Console
from rich.measure import Measurement
from rich.table import Table


table = Table(title="Star Wars Movies")

table.add_column("Released", style="cyan", no_wrap=True)
table.add_column("Title", style="magenta")
table.add_column("Box Office", justify="right", style="green")

table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$952,110,690")
table.add_row("May 25, 2018", "Solo: A Star Wars Story", "$393,151,347")
table.add_row("Dec 15, 2017", "Star Wars Ep. V111: The Last Jedi", "$1,332,539,889")
table.add_row("Dec 16, 2016", "Rouge One: A Star Wars Story", "$1,332,439,889")

console = Console()
console.print("-" * console.width)
console.print("CENTER", justify="center")
console.print(table, justify="center")

Default windows 10 terminal used on Version 1903 (OS-version 18362.900) with python 3.7.6 and rich 2.2.4.

@willmcgugan willmcgugan added the bug Something isn't working label Jun 23, 2020
@willmcgugan willmcgugan mentioned this issue Jun 23, 2020
9 tasks
@willmcgugan
Copy link
Collaborator

Please give v2.2.5 a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants