Share an AG Grid table as a link
AI tools build sortable, filterable data tables with AG Grid. Load AG Grid from a CDN in one HTML file, give the grid a height, then upload it and send a link.
Ask Claude or ChatGPT for a data table people can sort and filter, and the code often uses AG Grid. It works in the chat preview. Saved and opened somewhere else, the same code can show an empty page, a console error, or a grid with no styling.
AG Grid Community runs in the browser with no server, so one HTML file is enough. Load it from a CDN, put the rows in the file, and upload it.
The file
Put the table code in an HTML file, with AG Grid loaded first:
- ✓<script src="https://cdn.jsdelivr.net/npm/ag-grid-community@36.2.0/dist/ag-grid-community.min.js"></script>
- ✓<div id="grid" style="height: 500px"></div>
- ✓Then a <script> with the rows and columns and agGrid.createGrid(document.getElementById("grid"), { rowData, columnDefs }).
- ✓Tested in Chrome with AG Grid 36.2.0: rows drew, a column sorted descending, and a column filter was available.
Blank page, no error
The grid fills the height of the element it sits in. A <div> with no height is 0 pixels tall, so the grid is invisible. In our test the rows were in the page but the grid measured 2 pixels tall, and the console showed no error.
Give the element a height, as in style="height: 500px". For a grid that fills the window, use height: 100vh, or set domLayout: "autoHeight" in the grid options for short tables so the grid grows with its rows.
Error "agGrid.Grid is not a constructor"
Older AG Grid code starts the grid with new agGrid.Grid(element, options). Current versions removed that, and in AG Grid 36.2.0 the page stops with "agGrid.Grid is not a constructor".
Replace that line with agGrid.createGrid(element, options). The options object stays the same. If the code later calls options.api, keep what createGrid returns instead: const api = agGrid.createGrid(element, options).
Console says "AG Grid: error #239"
Older code also links ag-grid.css and a theme file such as ag-theme-alpine.css, and puts class="ag-theme-alpine" on the grid. Current AG Grid styles itself from the script, and mixing in the old stylesheets logged error #239 in our test.
Delete the two <link> tags and the ag-theme class. With only the script tag, the grid drew with its default theme and the console was clean.
Code that starts with import
Code written for a build tool starts with import { createGrid } from "ag-grid-community". A browser does not know where that package lives. Either remove the import and use the script tag above, or add an import map in the head: <script type="importmap">{ "imports": { "ag-grid-community": "https://esm.sh/ag-grid-community@36.2.0" } }</script> and keep the code in a <script type="module">. The import map version, with ModuleRegistry.registerModules([AllCommunityModule]) before createGrid, was tested.
Upload it and send the link
Drag the file onto the FileShare Pro dashboard and copy the link. Viewers need no account. The page opens in View mode, so sorting, filtering and scrolling work.
Turn on comments and reviewers can pin notes to a spot on the page after typing a name. When the data changes, upload the new file over the old one; the link stays the same: updating a shared link without changing it.
Related: sharing a sortable HTML table as a link, sharing an Excel sheet as a web page and why a page that works in chat breaks when hosted.
Frequently asked
The rows live inside the HTML file, so the limit is the file size: up to 100 MB on the free plan. AG Grid draws only the rows on screen: in our test with 10,000 rows, 21 were in the page at a time.
This guide covers AG Grid Community. Enterprise features such as row grouping need the ag-grid-enterprise package and a license key from AG Grid.
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