pretty-html-table
Make pandas dataframe looking pretty again
What it is and what it does
pretty_html_table wraps pandas DataFrames in styled HTML markup designed specifically for email delivery. Rather than relying on CSS stylesheets that email clients often strip or misinterpret, it applies inline row-level formatting—alternating row colors, bold headers, and font styling—that survives transmission through most email providers. The package includes 12 predefined color themes (blue, grey, orange, yellow, green, red, each in light and dark variants) and accepts optional arguments for font family, size, alignment, column widths, and conditional cell coloring based on numeric ranges.
The intended workflow is: load data into a pandas DataFrame, call build_table() with a theme name, and embed the resulting HTML string directly into an email body using any Python email library (the standard library's email module, O365, or others). The package handles the formatting details so you don't have to wrestle with CSS compatibility across Gmail, Outlook, Apple Mail, and other clients.
Use it for:
- Send styled data reports via email without worrying about CSS stripping or font rendering issues across email clients.
- Generate executive dashboards or KPI summaries as HTML tables embedded in automated email alerts.
- Convert Excel or CSV data to visually distinct email tables with alternating row colors and themed headers.
- Build conditional formatting into email tables (e.g., highlight ages under 25 in red, over 60 in green) without manual HTML editing.
- Integrate DataFrame-to-email workflows in reporting pipelines that use pandas for data processing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts pandas DataFrames into styled HTML tables ready for email, with 12 built-in color themes and row-level formatting that works across email providers.
Yes, if you regularly send DataFrame reports via email and want styled tables without CSS headaches. The single pandas dependency keeps install friction low, the permissive license poses no barrier, and no known vulnerabilities exist. The dormant maintenance status (last release 2022) is a minor concern—verify it works with your pandas version before relying on it in production, but for a stable, narrow-purpose tool this is acceptable.
Install
pretty-html-table on PyPI
pip
pip install pretty-html-tableuv
uv add pretty-html-tablepoetry
poetry add pretty-html-tableInstalling pretty-html-table
Before you install
Low friction install with a single runtime dependency on pandas. The package is dormant (last release 2022-04-25, 1572 days ago) but has no recent maintenance issues flagged and remains in the top 5000 PyPI packages by download volume.
License in practice
MIT license (permissive) means you can use, modify, and distribute the package freely with minimal restrictions—suitable for commercial and private projects.
Quickstart
from pretty_html_table import build_table
import pandas as pd
df = pd.read_excel('data.xlsx')
html_table = build_table(df, 'blue_light')
with open('table.html', 'w') as f:
f.write(html_table)
Verify before relying
- Whether the package works with current pandas versions (last release was 2022-04-25)
- Email client compatibility across modern webmail providers (Gmail, Outlook, etc.)
- Whether Century Gothic font fallback behavior is reliable across recipients
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pandas |
| Maintenance | dormant — 1,572 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,785,592/month — #3,564 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pretty_html_table-0.9.16-py3-none-any.whl
Tags
More HTML packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
MarkdownConverts Markdown text to HTML using a Python…
permissive · top 1,000 on PyPI
gspread-dataframeConverts between Google Sheets worksheets and…
permissive · top 5,000 on PyPI
pandas-read-xmlConverts XML files into pandas DataFrames, with…
permissive · top 15,000 on PyPI
texttableCreates formatted ASCII tables for console…
permissive · top 1,000 on PyPI
py-markdown-tableGenerates formatted markdown tables from lists…
permissive · top 5,000 on PyPI
itablesRenders Pandas and Polars DataFrames as…
permissive · top 5,000 on PyPI
great-tablesGreat Tables transforms Pandas or Polars…
permissive · top 15,000 on PyPI
pandas-tdPandas-TD connects pandas DataFrames to…
permissive · top 15,000 on PyPI
css-inlineInlines CSS from style and link tags directly…
permissive · top 5,000 on PyPI
lovelyplotsLovelyPlots provides matplotlib style sheets…
permissive · top 15,000 on PyPI