<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jessy Shen</title>
    <description>The latest articles on DEV Community by Jessy Shen (@jessyshen).</description>
    <link>https://dev.to/jessyshen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4113444%2Fa0b56206-303b-45f2-82d4-86dc6c353736.png</url>
      <title>DEV Community: Jessy Shen</title>
      <link>https://dev.to/jessyshen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jessyshen"/>
    <language>en</language>
    <item>
      <title>Why your table export only has the rows you can see</title>
      <dc:creator>Jessy Shen</dc:creator>
      <pubDate>Thu, 10 Sep 2026 04:37:24 +0000</pubDate>
      <link>https://dev.to/jessyshen/why-your-table-export-only-has-the-rows-you-can-see-1l38</link>
      <guid>https://dev.to/jessyshen/why-your-table-export-only-has-the-rows-you-can-see-1l38</guid>
      <description>&lt;p&gt;The table says 2,431 rows. You export it and get 50. Nothing errored.&lt;/p&gt;

&lt;p&gt;This is almost always virtualisation, and it is worth ten minutes of your time&lt;br&gt;
to understand, because it is the one failure mode where a tool that says&lt;br&gt;
nothing is worse than a tool that refuses.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is happening
&lt;/h2&gt;

&lt;p&gt;Rendering thousands of rows is slow, so grids render a window: the rows you can&lt;br&gt;
see plus a few above and below. As you scroll, rows outside that window are&lt;br&gt;
removed from the page and new ones are created. react-window, react-virtualized,&lt;br&gt;
TanStack Virtual and AG Grid's own row virtualisation all work this way, and so&lt;br&gt;
does every infinite-scroll list.&lt;/p&gt;

&lt;p&gt;So at any moment the page contains fifty rows. Not fifty visible out of 2,431&lt;br&gt;
present, fifty present. Copy, select-all, an extension, a console script: they&lt;br&gt;
all read the same page, and they all get fifty, because that is what is there.&lt;/p&gt;
&lt;h2&gt;
  
  
  Confirming it
&lt;/h2&gt;

&lt;p&gt;Paste this into the DevTools console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[role="grid"],[role="treegrid"],table&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;aria-rowcount&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;inPage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[role="row"],tr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;aria-rowcount&lt;/code&gt; attribute is the grid telling assistive technology how many&lt;br&gt;
rows exist in total. When that number is much larger than the number of rows in&lt;br&gt;
the page, you have your answer. Not every grid sets it, but the well-behaved&lt;br&gt;
ones do.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do, in order of how well it works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Find the page's own export.&lt;/strong&gt; A Download CSV or Export to Excel button&lt;br&gt;
asks the server and returns every row. This is the only route that is both&lt;br&gt;
complete and reliable, and it is worth looking for properly before trying&lt;br&gt;
anything else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Turn up the page size.&lt;/strong&gt; Many grids have a rows-per-page control at the&lt;br&gt;
bottom offering 25, 50, 100 or All. Switching to the largest value often turns&lt;br&gt;
off virtualisation entirely, and then a normal copy or extract gets everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Check for a print view or a URL parameter.&lt;/strong&gt; Plenty of internal tools&lt;br&gt;
accept a limit or per-page value in the query string, or have a printable&lt;br&gt;
version that renders the whole set as a plain table. Look at what the&lt;br&gt;
pagination links put in the URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Scroll the whole grid, then extract.&lt;/strong&gt; This works only on grids that keep&lt;br&gt;
rows once they have been rendered, which is a minority. On a true virtualiser&lt;br&gt;
the rows behind you are already gone, so scrolling gains you nothing. Try it,&lt;br&gt;
then re-check the count with the snippet above before you trust the result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Go to the API.&lt;/strong&gt; Open the Network tab, filter to Fetch/XHR, page the grid&lt;br&gt;
so it refetches, and read the JSON. Usually you can request a larger page size&lt;br&gt;
directly. Right-click the request, Copy as cURL, and it carries your session&lt;br&gt;
with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why an extension cannot fix this for you
&lt;/h2&gt;

&lt;p&gt;A browser extension sees the same DOM you do. There is no privileged path to&lt;br&gt;
rows that were never rendered. An extension could scroll the grid for you, but&lt;br&gt;
on a real virtualiser that discards what it scrolls past, and on an&lt;br&gt;
infinite-scroll list it can take minutes and still miss rows that load late.&lt;/p&gt;

&lt;p&gt;What a tool can do is tell you. &lt;a href="https://gridpick-app.netlify.app/" rel="noopener noreferrer"&gt;GridPick&lt;/a&gt; compares the number of rows&lt;br&gt;
actually in the page against what the grid claims, and says so before you&lt;br&gt;
export, instead of handing you 50 rows out of 2,431 and letting you find out&lt;br&gt;
later. Most tools say nothing, which is how a partial export ends up in a&lt;br&gt;
report.&lt;/p&gt;

&lt;h2&gt;
  
  
  The version of this that is not virtualisation
&lt;/h2&gt;

&lt;p&gt;Two other things produce the same symptom and have different fixes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pagination.&lt;/strong&gt; The grid genuinely shows 50 rows and there are 49 more pages.
Look for the page control, or set rows-per-page to All.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lazy loading on scroll.&lt;/strong&gt; Rows are appended as you reach the bottom, and
nothing is removed. Here scrolling to the end really does work: scroll until
the count stops growing, then extract.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The console snippet above tells the three apart in one line, so run it first.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Exporting a table that is not a table: React, AG Grid and other div grids</title>
      <dc:creator>Jessy Shen</dc:creator>
      <pubDate>Mon, 07 Sep 2026 08:02:55 +0000</pubDate>
      <link>https://dev.to/jessyshen/exporting-a-table-that-is-not-a-table-react-ag-grid-and-other-div-grids-k5a</link>
      <guid>https://dev.to/jessyshen/exporting-a-table-that-is-not-a-table-react-ag-grid-and-other-div-grids-k5a</guid>
      <description>&lt;h1&gt;
  
  
  Exporting a table that is not a &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;The symptom is always the same. You are looking at something that is&lt;br&gt;
unmistakably a table, with headers and rows and sortable columns, and the tool&lt;br&gt;
you reached for says there is no table on this page.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why it happens
&lt;/h2&gt;

&lt;p&gt;Modern data grids do not use &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt; markup. AG Grid, MUI DataGrid, TanStack&lt;br&gt;
Table, Handsontable, Ant Design Table and most in-house React grids render&lt;br&gt;
nested div elements instead, and describe the structure to screen readers with&lt;br&gt;
ARIA roles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"grid"&lt;/span&gt; &lt;span class="na"&gt;aria-rowcount=&lt;/span&gt;&lt;span class="s"&gt;"2431"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"columnheader"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Ticker&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"columnheader"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Last&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"gridcell"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;AAPL&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"gridcell"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;228.14&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They do it because table layout is hard to virtualise, hard to pin columns in,&lt;br&gt;
and hard to resize smoothly. The trade is that anything looking for&lt;br&gt;
&lt;code&gt;document.querySelectorAll('table')&lt;/code&gt; comes back empty.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to tell in five seconds
&lt;/h2&gt;

&lt;p&gt;Open DevTools, go to the Console, and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;table&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[role="grid"], [role="treegrid"], [role="table"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the first is 0 and the second is not, you have a div grid, and you now know&lt;br&gt;
why the extension found nothing.&lt;/p&gt;
&lt;h2&gt;
  
  
  What actually works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Look for the grid's own export first.&lt;/strong&gt; Many admin panels have a Download CSV&lt;br&gt;
or Export button hiding in a toolbar or a row of icons. It is worth ten seconds&lt;br&gt;
of looking, because that route asks the server and gets every row, not just the&lt;br&gt;
ones on screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use an extractor that reads ARIA roles.&lt;/strong&gt; Anything that walks &lt;code&gt;role="row"&lt;/code&gt;&lt;br&gt;
and &lt;code&gt;role="gridcell"&lt;/code&gt; handles div grids. &lt;a href="https://gridpick-app.netlify.app/" rel="noopener noreferrer"&gt;GridPick&lt;/a&gt; was built around this&lt;br&gt;
case: it reads real table markup and ARIA grids, and it walks open shadow&lt;br&gt;
roots, which matters because &lt;code&gt;querySelectorAll&lt;/code&gt; does not cross a shadow&lt;br&gt;
boundary and several component libraries put their grid inside one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Or paste this into the console.&lt;/strong&gt; For a one-off, this copies the visible grid&lt;br&gt;
to your clipboard as tab-separated text, ready to paste straight into Excel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;([...&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[role="row"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;[role="gridcell"],[role="columnheader"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sr"&gt;+/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;copy()&lt;/code&gt; is a DevTools helper, not a page function, so this only works from the&lt;br&gt;
console. If the grid is inside an iframe, switch the console context dropdown&lt;br&gt;
to that frame first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two things that will still bite you
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Only the visible rows are in the page.&lt;/strong&gt; Virtualised grids create and destroy&lt;br&gt;
rows as you scroll, so the DOM holds fifty of them no matter how many the grid&lt;br&gt;
claims. Nothing running in the browser can see the rest. See&lt;br&gt;
&lt;a href="https://gridpick-app.netlify.app/table-export-missing-rows" rel="noopener noreferrer"&gt;why your table export only has the rows you can see&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merged headers move your columns.&lt;/strong&gt; A header cell spanning two columns, or a&lt;br&gt;
section row written as &lt;code&gt;colspan="99"&lt;/code&gt;, quietly shifts everything under it. A&lt;br&gt;
naive extractor produces a 99-column export from that section row. The fix is&lt;br&gt;
to measure the real column count from the widest rows and clamp every span to&lt;br&gt;
it, which is what GridPick does before it hands you anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  If the grid is server-driven
&lt;/h2&gt;

&lt;p&gt;When the page fetches its rows from an API, the cleanest route is not the DOM&lt;br&gt;
at all. Open the Network tab, filter to Fetch/XHR, sort the grid or turn a page&lt;br&gt;
so it refetches, and look at the JSON response. Most of the time you can call&lt;br&gt;
that endpoint yourself with a larger page size and get everything in one&lt;br&gt;
request. Copy the request as cURL from the context menu and it carries your&lt;br&gt;
session cookies with it.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
