HOSTING

Share a pandas DataFrame as a web page

pandas writes any DataFrame to an HTML table with to_html, and the Styler adds formatting and colors. Upload the file and send a link that opens the table in any browser, with no Python, Jupyter or spreadsheet app on the other end.

4 min read·

A table pasted into chat loses its columns, a CSV asks the reader to open a spreadsheet, and a screenshot cannot be searched or copied from. pandas can write the DataFrame to an HTML file, and a hosted link opens it as a readable table in any browser. For a full profile of a dataset instead of the table itself, see sharing a pandas profiling report.

Plain table: DataFrame.to_html

  • ✓df.to_html("table.html") writes every row and column. Add index=False to drop the row numbers.
  • ✓float_format="{:,.2f}".format sets decimals and thousands separators for every float column.
  • ✓The output is a bare <table> with border="1" and no page around it. Browsers open it fine, but it has no styling beyond the border.

Formatted table: the Styler

  • ✓df.style.format({"sales": "{:,.2f}"}).highlight_max(subset=["sales"]) formats one column and highlights its largest value. background_gradient adds a color scale (it needs matplotlib installed) and bar draws an in-cell bar.
  • ✓Save it as a full page: .to_html("table.html", doctype_html=True). That adds the <html>, <head> and charset around the table.
  • ✓Hide the row numbers with .hide(axis="index") and add a title with .set_caption("Q3 sales by region").
  • ✓set_table_styles takes CSS for borders, fonts and header colors, which then live inside the file.

Why a large Styler table stops partway

The Styler stops rendering once rows times columns passes 262,144 cells, its default styler.render.max_elements, and it does not warn. A 300,000-row, 2-column frame saved through the Styler came out with fewer than half its rows (pandas 3.1); the same frame through df.to_html kept every row. Raise the limit with pd.set_option("styler.render.max_elements", 2_000_000), or filter to the rows the reader needs. A table of hundreds of thousands of rows is slow to scroll in any browser either way.

Upload it and send the link

Drag table.html onto the FileShare Pro dashboard and copy the link. The free plan accepts files up to 100 MB. Shared pages are served as UTF-8, so names with accents and non-Latin text display correctly.

Viewers need no account and nothing to install, and they can select and copy cells straight from the page. Shared pages carry a noindex tag, so a table of internal numbers does not appear in search results. On Pro you can add a password: password-protecting an HTML page.

Update the table without a new link

Rerun the script, write the file again and upload it over the old one. The link stays the same and the previous version is kept in history: updating a shared link without changing it.

Turn on comments and readers can leave a note on the page after typing a name, such as a question about one row. The view count shows whether the person you sent it to has opened it. For charts of the same data, see sharing a Plotly chart.

Frequently asked

How do I share a pandas DataFrame with someone who does not use Python?

Run df.to_html("table.html") or df.style.to_html("table.html", doctype_html=True), upload the file and send the link. It opens as a table in any browser.

How do I keep number formatting and highlights?

Use the Styler: df.style.format(...) plus highlight_max, background_gradient or bar, then .to_html with doctype_html=True. The formatting is written into the file.

Why is my styled table missing rows?

The Styler renders at most 262,144 cells by default and drops the rest without a warning. Raise styler.render.max_elements with pd.set_option, or use df.to_html, which writes every row.

Can I share a DataFrame from a Jupyter notebook?

Yes. Run the same to_html line in a cell; the file lands next to the notebook. To share the whole notebook, see the Jupyter guide.

Is it free?

Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free