Skip to content

How would I add two justified texts to a panel #1443

Answered by willmcgugan
wasi-master asked this question in Q&A
Discussion options

You must be logged in to vote

You can create a Table.grid and right align the second column.

from rich import print
from rich.panel import Panel
from rich.table import Table


table = Table.grid(expand=True)
table.add_column()
table.add_column(justify="right")
table.add_row("some text", "May 04, 2021")
print(Panel(table))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wasi-master
Comment options

Answer selected by wasi-master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants