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.
Β» pip install rich-tools