Skip to content

Instantly share code, notes, and snippets.

@kytta
Created February 26, 2026 13:42
Show Gist options
  • Select an option

  • Save kytta/d2f7fde2bdddbc0472e5ceb8c9d6b9bb to your computer and use it in GitHub Desktop.

Select an option

Save kytta/d2f7fde2bdddbc0472e5ceb8c9d6b9bb to your computer and use it in GitHub Desktop.
booktabs-style Box for Rich tables
from rich.box import Box
BOOKTABS = Box(
" ━━ \n"
" \n"
" ─ \n"
" \n"
" \n"
" ── \n"
" \n"
" ━━ \n"
)
###
from rich import print
from rich.table import Table
table = Table(box=BOOKTABS)
# ...
print(table)
@kytta
Copy link
Author

kytta commented Feb 26, 2026

Output:

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
      Released   Title                                   Box Office
 ────────────── ─────────────────────────────────── ────────────────
  Dec 20, 2019   Star Wars: The Rise of Skywalker      $952,110,690
  May 25, 2018   Solo: A Star Wars Story               $393,151,347
  Dec 15, 2017   Star Wars Ep. V111: The Last Jedi   $1,332,539,889
  Dec 16, 2016   Rogue One: A Star Wars Story        $1,332,439,889
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment