skillfed

pretty-html-table

Make pandas dataframe looking pretty again

pretty-html-table v0.9.16 1.8M downloads/30d#3,564 on PyPI128
Permissive license DORMANT released

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-table

uv

uv add pretty-html-table

poetry

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 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

pandas dataframe to html emailpretty html table generatorstyled email tables pythondataframe html formattingemail-ready table stylingpandas table color themeshtml table for email reports
email-formattingdataframe-export

More HTML packages