Share a searchable, sortable HTML table as a link
DataTables turns a plain HTML table into one with search, column sorting and paging, all in the browser. Put the table and two script tags in one HTML file, upload it, and send a link that opens the working table.
A spreadsheet attachment makes the recipient open Excel, and a screenshot of a table cannot be searched or sorted. A plain HTML table opens anywhere but has neither.
DataTables adds a search box, click-to-sort column headers and paging to an ordinary <table>, all in the browser. One HTML file with the rows inside it, hosted at a link, opens the working table on any device.
Build the table in one file
Create table.html with this structure:
- ✓<!doctype html>, <meta charset="utf-8"> and <meta name="viewport" content="width=device-width, initial-scale=1"> in the head.
- ✓The stylesheet: https://cdn.jsdelivr.net/npm/datatables.net-dt@3.1.5/css/dataTables.dataTables.min.css.
- ✓Two script tags with pinned versions: https://cdn.jsdelivr.net/npm/datatables.net@3.1.5/js/dataTables.min.js, then https://cdn.jsdelivr.net/npm/datatables.net-dt@3.1.5/js/dataTables.dataTables.min.js.
- ✓A normal table with an id, a <thead> row of column names and a <tbody> of rows: <table id="t">…</table>.
- ✓A <script> block after the table with new DataTable("#t");. DataTables 3 runs without jQuery.
- ✓Tested on DataTables 3.1.5 in Chrome: a three-row table got a search box, sortable headers and paging, with no jQuery on the page.
Keep the rows inside the page
Rows can sit in the HTML as <tr> elements, or in the script: new DataTable("#t", { columns: [{ title: "Region" }, { title: "Orders" }], data: [["North", 120], ["South", 95]] }). Both work from a hosted page.
The ajax option, as in ajax: "rows.json", requests a second file. An uploaded page is hosted on its own, so that request fails and the table stays empty. Paste the rows into the page instead.
Every row needs a cell for every column. A short row stops with the alert "DataTables warning: table id=t - Requested unknown parameter '1' for row 0, column 1."
Starting from a spreadsheet or a DataFrame? Sharing an Excel sheet as a web page and sharing a pandas DataFrame as a web page cover getting the rows into HTML first.
Upload it and send the link
Drag the .html file onto the FileShare Pro dashboard and copy the link. The table loads ready to search and sort, and viewers need no account.
If the page shows a plain table with no search box once hosted, open the browser console. "DataTable is not defined" means the script tag is missing or comes after your table code. Why an AI page works in chat but breaks when hosted covers tables an assistant wrote.
Turn on comments and viewers can leave a note on the page after typing a name. When the numbers change, upload the new file over the old one and the link stays the same: updating a shared link without changing it.
Frequently asked
Put the DataTables stylesheet and script tags, your table and new DataTable("#t") into one HTML file, upload it to a host that serves HTML as a web page, and send the link.
Not in version 3. The table in this guide was tested with DataTables 3.1.5 and no jQuery on the page.
Usually a script tag is missing, loads after your table code, or the rows come from a file that was not uploaded. Check the browser console for the exact error.
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.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free