After playing around with padding and line/edge visibility this is what I've come up with.

Column A is updated while column B is the same as your example code for reference. I've also tried varying the show_lines parameter in the column A inner table (show_lines=True on top, False on the bottom), which just toggles the visibility of the horizontal lines.

As far as I know this is the closest we can get to the table looking right without the characters being replaced at the line intersections, which would require new functionality in the rich library per this github discussion:

┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃A         ┃B               ┃
┑━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
β”‚C   ┃D    │┏━━━━━━┳━━━━━━━┓│
│━━━━╇━━━━━│┃ E    ┃ F     ┃│
β”‚testβ”‚test2│┑━━━━━━╇━━━━━━━┩│
│────┼─────││ test β”‚ test2 β”‚β”‚
β”‚testβ”‚test2β”‚β”‚ test β”‚ test2 β”‚β”‚
│────┼─────││ test β”‚ test2 β”‚β”‚
β”‚testβ”‚test2β”‚β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Per the dev: "This feature is called "colspan", which isn't currently supported. It might be in the future."

My example code:

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

table = Table(title="Nested", padding=(0, 0))
table.add_column("A")
table.add_column("B")

st = Table(
    padding=(0, 0),
    show_edge=False,
    show_lines=True,
)
st.add_column("C")
st.add_column("D")
for _ in range(3):
    st.add_row("test", "test2")

tt = Table()
tt.add_column("E")
tt.add_column("F")
for _ in range(3):
    tt.add_row("test", "test2")

table.add_row(st, tt)

console = Console()
console.print(table)

Update/Note: you can actually remove padding=(0, 0) on the inner table without affecting the grid lines.

Answer from Mandias on Stack Overflow
🌐
Medium
medium.com β€Ί @alextrotman04 β€Ί enhance-your-cli-with-rich-python-tables-made-simple-6cdabbd59801
Enhance Your CLI with Rich: Python Tables Made Simple | by Alex Trotman | Medium
May 10, 2024 - The rich library isn't just another output formatter. It's a versatile and powerful tool that offers: Tables: Create beautiful tables with custom styles and layouts.
🌐
Rich
rich.readthedocs.io β€Ί en β€Ί stable β€Ί reference β€Ί table.html
rich.table β€” Rich 14.1.0 documentation
class rich.table.Table(*headers, title=None, caption=None, width=None, min_width=None, box=Box(...), safe_box=None, padding=(0, 1), collapse_padding=False, pad_edge=True, expand=False, show_header=True, show_footer=False, show_edge=True, show_lines=False, leading=0, style='none', row_styles=None, header_style='table.header', footer_style='table.footer', border_style=None, title_style=None, caption_style=None, title_justify='center', caption_justify='center', highlight=False)[source]
Top answer
1 of 1
2

After playing around with padding and line/edge visibility this is what I've come up with.

Column A is updated while column B is the same as your example code for reference. I've also tried varying the show_lines parameter in the column A inner table (show_lines=True on top, False on the bottom), which just toggles the visibility of the horizontal lines.

As far as I know this is the closest we can get to the table looking right without the characters being replaced at the line intersections, which would require new functionality in the rich library per this github discussion:

┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃A         ┃B               ┃
┑━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
β”‚C   ┃D    │┏━━━━━━┳━━━━━━━┓│
│━━━━╇━━━━━│┃ E    ┃ F     ┃│
β”‚testβ”‚test2│┑━━━━━━╇━━━━━━━┩│
│────┼─────││ test β”‚ test2 β”‚β”‚
β”‚testβ”‚test2β”‚β”‚ test β”‚ test2 β”‚β”‚
│────┼─────││ test β”‚ test2 β”‚β”‚
β”‚testβ”‚test2β”‚β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Per the dev: "This feature is called "colspan", which isn't currently supported. It might be in the future."

My example code:

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

table = Table(title="Nested", padding=(0, 0))
table.add_column("A")
table.add_column("B")

st = Table(
    padding=(0, 0),
    show_edge=False,
    show_lines=True,
)
st.add_column("C")
st.add_column("D")
for _ in range(3):
    st.add_row("test", "test2")

tt = Table()
tt.add_column("E")
tt.add_column("F")
for _ in range(3):
    tt.add_row("test", "test2")

table.add_row(st, tt)

console = Console()
console.print(table)

Update/Note: you can actually remove padding=(0, 0) on the inner table without affecting the grid lines.

🌐
GitHub
github.com β€Ί Textualize β€Ί rich β€Ί blob β€Ί main β€Ί rich β€Ί table.py
rich/rich/table.py at main Β· Textualize/rich
Rich is a Python library for rich text and beautiful formatting in the terminal. - rich/rich/table.py at main Β· Textualize/rich
Author: Textualize
🌐
Rich
rich.readthedocs.io β€Ί en β€Ί stable β€Ί tables.html
Tables β€” Rich 14.1.0 documentation
To render a table, construct a Table object, add columns with add_column(), and rows with add_row() – then print it to the console. ... from rich.console import Console from rich.table import Table table = Table(title="Star Wars Movies") table.add_column("Released", justify="right", style="cyan", ...
🌐
Medium
medium.com β€Ί @ahmedharabi β€Ί get-started-with-the-python-rich-library-2736b1b57941
Get Started with the Python rich Library | by Ahmed Harabi | Medium
July 4, 2024 - The rich library is a powerful Python tool for creating visually appealing terminal output. It supports rich text formatting, tables, markdown, syntax highlighting, and much more.
🌐
Medium
medium.com β€Ί @jainsnehasj6 β€Ί a-practical-guide-to-rich-12-ways-to-instantly-beautify-your-python-terminal-3a4a3434d04a
A Practical Guide to Rich: 12 Ways to Instantly Beautify Your Python Terminal | by Sneha Jain | Medium
June 26, 2025 - from rich.live import Live from ... range(5): time.sleep(1) live.update(make_status_table(i)) ... Rich adds instant polish to Python scripts and terminal apps....
🌐
Salivity
salivity.github.io β€Ί python β€Ί article β€Ί python-rich-tables-syntax-and-progress-bars
Python Rich: Tables, Syntax, and Progress Bars - python
The Python Rich library transforms standard command-line interfaces by introducing advanced formatting, vibrant color, and structured visual elements to terminal output. This article examines how developers can leverage Rich to replace plain ...
Find elsewhere
🌐
Towards Data Science
towardsdatascience.com β€Ί home β€Ί latest β€Ί display rich text in the console using python
Display Rich Text In The Console Using Python | Towards Data Science
January 22, 2025 - Recently, I found an amazing Python library called "Rich" on GitHub, which already has 15.2k stars by the time I'm writing this article. It can not only display text in colour and styles in the terminal but also emoji, tables, progress bars, markdown and even syntax highlighted code.
🌐
GitHub
github.com β€Ί Textualize β€Ί rich
GitHub - Textualize/rich: Rich is a Python library for rich text and beautiful formatting in the terminal. Β· GitHub
Rich is a Python library for rich text and beautiful formatting in the terminal. The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, ...
🌐
PyPI
pypi.org β€Ί project β€Ί rich-tools
rich-tools Β· PyPI
# Print csv data to the terminal as a pretty printed rich formatted table import pandas as pd from rich import print from rich_tools import df_to_table if __name__ == '__main__': df = pd.read_csv("sample_input.csv") table = df_to_table(df) print(table) Like the rich package itself, its creator Will McGugan is awesome! Check out Textual "a TUI (Text User Interface) framework for Python inspired by modern web development".
      Β» pip install rich-tools
    
Published: Aug 26, 2025
Version: 0.6.0
🌐
freeCodeCamp
freecodecamp.org β€Ί news β€Ί use-the-rich-library-in-python
How to Use the Rich Library with Python
February 8, 2022 - Rich is a Python library for writing rich text (with color and style) to the terminal. It lets you display advanced content such as tables, markdown, and syntax-highlighted code.
🌐
ZetCode
zetcode.com β€Ί python β€Ί rich
Python rich - how to create rich text & formatting in the terminal
In the next example, we display BTC OHLCV data in a table. The example uses the ccxt module to fetch data from the Binance exchange. ... #!/usr/bin/python import asyncio import ccxt.async_support as ccxt from rich import box from rich.console import Console from rich.table import Table from datetime import datetime async def tickers(): binance = ccxt.binance() data = await binance.fetch_ohlcv('BTC/USDT', '1d', limit=20) await binance.close() now = f'{datetime.today()}' table = Table(title='Binance - BTC/USDT', box=box.ASCII, caption=now, caption_justify='left') table.add_column('Date', justify
🌐
PyPI
pypi.org β€Ί project β€Ί rich-tables
rich-tables Β· PyPI
JSON human-prettifier based on the brilliant rich python library. Since my usual day involves building and interacting with various APIs, JSON data is constantly flying around the terminal. Reading JSON data (even when it's prettified by, say, jq) requires a fair bit of mental effort; and it's basically impossible to analyse / make sense of it just by looking at it. This project initially started as a way to solve this issue – it takes JSON data as an input and prints it in (rich-)tables, making it somewhat more readable for humans.
🌐
Real Python
realpython.com β€Ί python-rich-package
The Python Rich Package: Unleash the Power of Console Text – Real Python
July 3, 2026 - Rich is a powerful library for constructing text-based user interfaces (TUIs) using Python. With it, you can make your code more readable by pretty-printing complex data structures, and you can make your app more attractive for your user with ...
🌐
Calmcode
calmcode.io β€Ί course β€Ί rich β€Ί tables
How to print a pretty table in the terminal with Rich.
Tables are another nice feature that are nice to have in the terminal! from rich.console import Console from rich.table import Table table = Table(title="Pandas Versions") table.add_column("Released", style="cyan") table.add_column("Version Number", justify="right", style="magenta") table.add_column("Description", style="green") table.add_row("May 29, 2020", "v1.0.4", "Just an update.") table.add_row("Mar 18, 2020", "v1.0.3", "Just an update.") table.add_row("Mar 15, 2020", "v1.0.2", "Just an update.") table.add_row("Feb 05, 2020", "v1.0.1", ":thumbs_up: [underline]Big[/] update.") console = Console() console.print(table)
🌐
Blue Book
lyz-code.github.io β€Ί blue-book β€Ί rich
Rich - The Blue Book
Rich is a Python library for rich text and beautiful formatting in the terminal.
🌐
Real Python
realpython.com β€Ί lessons β€Ί bringing-tables-life
Bringing Tables to Life (Video) – Real Python
Join us and get access to thousands of tutorials and a community of expert Pythonistas. ... 00:00 Bringing tables to life. If you are working with a lot of data, then often a table is the most compact way to present it, but displaying data tables can be a little dry. 00:12 In this section, you’ll see how you can use Rich’s table building tools along with formatting and colorization to build a table that really grabs the user’s attention.
Published: February 20, 2024
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί installing-and-using-rich-package-in-python
Installing and Using Rich Package in Python - GeeksforGeeks
July 23, 2025 - For more options and functions ... tables in a rich format with the rich package. The rich package has a way to represent tabular data in the terminal with the Tables class....