how to make the width of each column even size? from rich.console import Console from…
- User
how to make the width of each column even size?
from rich.console import Console from rich.table import Table
table = Table()
table.add_column("bot1", style="cyan", no_wrap=True) table.add_column("bot2", style="magenta", no_wrap=True) table.add_column("bot3", style="green", no_wrap=True)
table.add_row("Dec 20, 20192222222222", "Star Wars: The Rise of Skywalker", "393,151,347") table.add_row("Dec 15, 2017", "Star Wars Ep. V111: The Last Jedi", "$1,332,539,889")
- Assistant
To make the widths of each column even in a table created with the
richlibrary, you need to explicitly set the of each column. However, the Rich library does not directly support setting all columns to the same width automatically based on the table width.