prepend characters to Panel #1701
-
It is known that vertical alignment doesn't work yet in Rich. As a workaround, how can I prepend newlines before from rich.console import Console
from rich.table import Table
from rich.panel import Panel
console = Console()
table = Table(show_header=False)
table.add_row("a\nb\nc\nd\ne\nf\ng\nh\ni\nj", Panel("test panel"))
console.print(table) |
Beta Was this translation helpful? Give feedback.
Answered by
willmcgugan
Nov 16, 2021
Replies: 2 comments 3 replies
-
Vertical alignment does work, but not yet in Table rows. You can use the Padding class to insert lines before a renderable. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nschloe
-
Padding works for both. You can put the Panel inside Padding, or Padding inside Panel. Rich doesn’t care which. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vertical alignment does work, but not yet in Table rows.
You can use the Padding class to insert lines before a renderable.