---
id: pretty-html-table
version: "0.9.16"
license: unclear
license_treatment: permissive
maintenance: dormant
---
# pretty-html-table — Make pandas dataframe looking pretty again
License: permissive · Maintenance: dormant · Downloads: 1.8M/mo
## 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 above — 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
pip install pretty-html-table
uv add pretty-html-table
poetry add pretty-html-table
## Installing 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: unspecified
- Install friction: low
- Maintenance: dormant
- Downloads: 1.8M/month (top 5,000 on PyPI)
- Known vulnerabilities: none known
## Tags
pandas dataframe to html email, pretty html table generator, styled email tables python, dataframe html formatting, email-ready table styling, pandas table color themes, html table for email reports, email-formatting, dataframe-export
[View on SkillFed](https://skillfed.io/packages/pretty-html-table) · [View on PyPI](https://pypi.org/project/pretty-html-table/)