tabulate

Utilities

Pretty-print tables

Try tabulate in PyRun

What is tabulate?

Tabulate is a Python library for pretty-printing tabular data to the terminal. It supports dozens of output formats including plain text, grid, pipe (Markdown), HTML, LaTeX, and more. It works with lists of lists, dicts, Pandas DataFrames, and NumPy arrays.

In PyRun, tabulate is available via micropip and is an excellent way to present data output clearly in the terminal panel. It's commonly used with Pandas to display DataFrames in a human-readable format, or to generate Markdown tables from Python data.

Code Example

Pretty-print data in grid, outline, and Markdown formats.

Tabulate Tables
Try in Editor
from tabulate import tabulate

data = [
    ["Alice",   28, "Engineer",  "New York"],
    ["Bob",     34, "Designer",  "London"],
    ["Charlie", 22, "Data Sci.", "Berlin"],
    ["Diana",   30, "Manager",   "Tokyo"],
]
headers = ["Name", "Age", "Role", "City"]

print("── grid ──")
print(tabulate(data, headers=headers, tablefmt="grid"))

print("\n── rounded_outline ──")
print(tabulate(data, headers=headers, tablefmt="rounded_outline"))

print("\n── pipe (Markdown) ──")
print(tabulate(data, headers=headers, tablefmt="pipe"))

Why run tabulate in PyRun?

  • Zero setup — no pip install, no virtual environment, no Python download
  • Instant results — powered by WebAssembly, runs locally in your browser
  • Share your code — generate a link and anyone can run it instantly
  • Works offline — after first load, PyRun runs without internet
Open editor with tabulate example

Related Packages