from rich.console import Console from rich.table import Table # Create a table table = Table(title="Student Scores") # Add columns to the table table.add_column("Name", justify="left", style="cyan", no_wrap=True) table.add_column("Subject", justify="center", style="magenta") table.add_column("Score", justify="right", style="green") # Add rows to the table table.add_row("Alice", "Math", "85") table.add_row("Bob", "Science", "90") table.add_row("Charlie", "History", "78") table.add_row("Diana", "English", "92") # Create a console for rich output to print to screen console = Console() console.print(table)