Key takeaways
  • Use a real table element with a caption, a thead, and th cells that carry a scope attribute, so rows and columns are explicit in the source.
  • Put units in headers, keep cells to bare values, and avoid merged cells, images, and content that only appears after scripts run.
  • Repeat the key figures in a sentence under the table, then check the raw response and bot logs, because markup alone guarantees nothing.

To make a table easy for AI systems to extract, use a real HTML table element, give it a caption, mark the header row with th elements that carry a scope attribute, and keep each cell to one fact with the unit written in the header. Then repeat the most important figures in a sentence near the table. You do not control whether a system reads the table, the surrounding prose, or both, so the sentence is insurance against the table being misread.

This article covers what markup can do and what it cannot. The HTML parts are well documented, and you can verify them yourself in a few minutes. The AI parts are less clear. The companies that run large language models and retrieval systems do not publish full accounts of how they parse tables, and their pipelines change without notice. Where I describe behaviour, I am describing what is plausible and testable, not what any particular system promises.

Why the table has to be a table in the markup

A table needs to be a table in the markup because a program reads a page as a tree of tags, not as a picture. If the table is a real table element, the tree already says which cells share a row and which share a column. If it is not, the program has to infer the grid from layout it cannot see, and that inference fails in the places where tables matter most: wide tables, tables with blank cells, and tables with footnotes.

Browsers build a visual rendering, but extraction usually starts from the source. A scraper, a search index, or a retrieval pipeline often starts from the HTML the server returned. Many of these systems convert that HTML into plain text or Markdown before doing anything else. A conversion step can keep a real table as a grid of rows and columns. A table built from divs often comes out as a stream of words with line breaks, and the relationship between a value and its column header is lost.

The same semantics feed assistive technology. Screen readers announce the column and row for each cell because the markup tells them to. That work has been around for a long time, and the people who maintain those tools have a strong reason to keep it working. This does not mean an AI extractor uses the same signals. It does mean that a table which is accessible is usually easier to parse, and that is the safer thing to optimise for.

Real table elements beat div tables

A table built from div elements and CSS grid can look identical on screen, but the document no longer says that its cells form rows and columns. Use table, tr, th, and td for tabular data, and keep CSS grid for layout.

Here is a pricing grid that looks right in a browser and says very little to a parser. The values are invented for illustration:

<div class="pricing-grid">
  <div class="grid-row">
    <div class="grid-cell grid-head">Plan</div>
    <div class="grid-cell grid-head">Monthly price</div>
    <div class="grid-cell grid-head">Included URLs</div>
  </div>
  <div class="grid-row">
    <div class="grid-cell">Starter</div>
    <div class="grid-cell">9</div>
    <div class="grid-cell">500</div>
  </div>
</div>

Nothing in that markup says that grid-head is a header. The class name means something to a person reading your stylesheet and nothing to a program reading the document. The same content as a real table:

<table>
  <caption>Plans, monthly price in USD, and included URLs</caption>
  <thead>
    <tr>
      <th scope="col">Plan</th>
      <th scope="col">Monthly price (USD)</th>
      <th scope="col">Included URLs</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Starter</th>
      <td>9</td>
      <td>500</td>
    </tr>
  </tbody>
</table>

Both versions look the same to a visitor. Only the second tells a program that 9 belongs to the Starter row and to the monthly price column. You can still style the real table with CSS, including with grid or flexbox if you need to. Styling does not replace semantics, and a class name does not turn a div into a header.

Headers give cells their meaning

A td cell is only a value. It becomes a data point when a header says what the value measures, and th with a scope attribute makes that link explicit. Use scope="col" for column headers and scope="row" for row labels.

The thead element groups the header row, and tbody holds the data. Some parsers use thead to decide which row is the header, and many do not check. The scope attribute is primarily an accessibility feature, but it also makes the relationship explicit in the source, which is what you want when the consumer of the page is not a person.

Do not mark headers with styling alone. A td styled to look bold is visually a header but semantically still a data cell. If the header row looks like a header, it should also be one in the markup.

Complex tables with two levels of headers are harder. A single scope value may not express the full relationship. The headers attribute on each td can list the ids of every header cell that applies, but it is verbose and tools handle it unevenly. The better fix is usually to flatten the table, putting the group and the column into one header, such as "Monthly price (USD)" rather than nesting it under a group header.

Captions and the text around the table

The caption element names the table, and the sentence before it says why the table is there. An extractor that keeps the caption can attach a label to the grid. One that drops it still has the surrounding text, if you wrote some.

Do not put the only statement of your finding in the caption. Captions are short, and many systems will not treat them as the main content. Place the table under a heading that uses the words a reader would search for, such as "Monthly price by plan." The heading and the caption together form the label, and the heading gives a chunking system a natural boundary.

Position matters more than people expect. Retrieval systems often split a page into sections at headings. If the table sits under the heading that describes it, a chunk containing that heading is more likely to contain the table. If the table is far from its heading, or split across two sections by a long paragraph, the chunk may separate the values from their context. Whether any given system does this is not something you can confirm from outside, so keep the table close to the text that explains it.

Keep tables simple and avoid merged cells

Merged cells, created with rowspan and colspan, are the most common reason a table that reads well to a person becomes ambiguous to a program. Where you can, repeat the value in each row or split the table instead of merging.

A rowspan cell appears once in the source but applies to several rows. A program that reads row by row has to remember that the cell continues into the next row, and many simple parsers do not. Column spans cause the same problem with headers. Empty cells are a related issue. A blank cell may mean zero, unknown, not applicable, or the same as the row above, and a parser cannot tell which. Write the value, or write "not applicable" consistently.

Here is a table with a merged region cell:

<table>
  <tr>
    <th scope="col">Region</th>
    <th scope="col">Plan</th>
    <th scope="col">Price (USD)</th>
  </tr>
  <tr>
    <td rowspan="2">Europe</td>
    <td>Starter</td>
    <td>9</td>
  </tr>
  <tr>
    <td>Team</td>
    <td>29</td>
  </tr>
</table>

The same data with the region repeated in every row:

<table>
  <caption>Price by region and plan, USD per month</caption>
  <thead>
    <tr>
      <th scope="col">Region</th>
      <th scope="col">Plan</th>
      <th scope="col">Price (USD)</th>
    </tr>
  </thead>
  <tbody>
    <tr><th scope="row">Europe</th><td>Starter</td><td>9</td></tr>
    <tr><th scope="row">Europe</th><td>Team</td><td>29</td></tr>
  </tbody>
</table>

The repeated version is longer, and that is fine. Each row now stands on its own, which is exactly what a row-by-row reader needs. Page weight from a few repeated words is negligible. If a grouping really matters to the reader, consider a separate table for each group, or a heading above each group, rather than a merged cell that only works when the reader can see the layout.

Put units in the header, not in every cell

Write the unit once, in the column header, and keep each cell to a bare value. A cell that reads "9 USD per month" is pleasant for a person and awkward for a parser, which must separate the number from the words before it can compare anything.

Consistency matters as much as placement. Use one number format within a column, whether that is a decimal place or none, and one thousands convention. "10,000" and "10000" both appear in the wild, and a system that normalises them may still make mistakes in mixed columns. For dates, ISO 8601 such as 2026-11-14 is unambiguous, while 04/05/2026 means different things in different countries.

Approximate values need care. A tilde or the word "about" inside a numeric cell is easy to read and hard to parse. If a value is an estimate, say so in the header or caption, such as "Estimated monthly volume." Avoid footnote markers like asterisks inside cells. If you need a footnote, put the explanation in prose under the table.

Ranges are a common case. A cell that says "100 to 250" is readable but not directly comparable. Two columns, one for the minimum and one for the maximum, are longer and much more useful to any system that does arithmetic or filtering.

Repeat the key figures in prose

State the two or three most important figures in a sentence directly under the table. A table is read correctly only if the consumer handles tables well. A sentence can be read by any system that handles text at all.

This is deliberate redundancy, and it has a cost. The table and the sentence can drift apart when someone edits one and forgets the other. Treat them as a pair. When you change a value, update both, and keep the sentence to the figures a reader is most likely to ask for. Do not paste the whole table into prose. That doubles the length of the page without adding anything a careful reader needs.

A useful test: if a reader quoted only your sentence, would it still be accurate and complete enough to be useful? If the answer is no, the sentence is doing the job of a caption, and it should say what the table shows, not just that a table exists.

Tables to avoid: images, scripts, and late rendering

A table that exists only as an image, or only after a script runs, may be invisible to the systems that matter to you. Check what the server actually returns before assuming anything.

Screenshots of tables are common in slide decks, exported reports, and some content management systems. Alt text can describe a table, but alt text is short and usually cannot hold forty cells with their relationships. If the table matters, make it text. If you must keep an image, publish the same content as a text table nearby, so the information does not depend on image processing.

Single-page applications and some component libraries render tables in the browser after the page loads. A visitor sees a table because the browser runs the script. A crawler that does not run scripts, or a pipeline that reads the raw response, sees an empty container. Some crawlers do execute JavaScript, and that varies by system and over time, so do not assume either way. Test it. Fetch the page without a browser and search the response for the table element or for a value you know is in the table:

curl -s https://example.com/pricing | grep -i "<table"

If nothing comes back, the table is not in the initial response. Move the data into server-rendered HTML, or into a static file the page includes. Tabs and accordions are a separate case. Content hidden with CSS is usually still present in the HTML and is fine. Content fetched only when a user clicks is not present until the click happens.

What markup cannot tell you

No markup guarantees that a system will extract your table, read it correctly, cite it, or show it in an answer. You can make the table easier to read, and you can check that it is present in the response, but the rest depends on systems whose internals you cannot inspect.

A few unknowns are worth naming:

The defensible claim is narrow. A well-marked table is easier to read as a table than a poorly marked one, and the reasoning behind that is sound. Whether it changes outcomes for your site is something you have to test on your own pages.

Measuring with bot logs

Server logs are the most direct evidence you will get that an automated system tried to read a page. They show which user agents fetched a URL, when, and what status they received. Fetching is not extraction, and extraction is not citation, so treat logs as the first link in the chain and measure the rest separately.

This is the part of the problem that InstantIndexingPro, our product, is built around. It submits URLs through IndexNow, the protocol that tells participating search engines a URL has changed, and it logs which bots fetch each URL so you can see whether a change was picked up. IndexNow does not describe how to parse a table, and not every AI crawler uses it. Treat submission as a way to prompt a re-fetch, and treat the logs as the evidence that a re-fetch happened.

For each page you change, record the date, the URL, which bots fetched it afterwards, the status codes they received, and which version of the markup was live. Change one thing at a time where you can. If you change the markup, the headings, and the prose in the same release, you will not know which change mattered, and you may not learn anything at all.

User agent strings are easy to fake. Before you count a request as coming from a known crawler, check the IP address against the provider's published ranges where one is published, or use reverse DNS for search engine crawlers. Otherwise a scraper pretending to be a crawler can end up in your numbers.

Sample size matters too. One page tells you very little. A useful comparison sets a group of similar pages where you changed the table markup against a group where you did not, then watches fetch patterns over several weeks. Other differences between the groups can explain the result, so the comparison is suggestive, not conclusive.

A fetch still does not tell you whether the table was parsed, or whether it was used. For that you need outputs. Ask the systems the question the table answers and see whether the response contains the right values. Record the date and the wording, because answers vary between runs, and one answer is not a measurement.

What to do

  1. Replace div-based tables with table elements, and keep CSS grid for layout only.
  2. Give every data table a caption, put the header row in thead, and mark each th with a scope attribute.
  3. Remove merged cells where you can, and repeat values in each row when you cannot.
  4. Move units into headers, keep cells to bare values, and use one format per column.
  5. Put the key figures in a sentence under the table, and update the two together.
  6. Fetch the page without a browser and confirm the table text appears in the response.
  7. Watch the logs for the crawlers you care about, verify their identity, and change one thing at a time.

None of this guarantees extraction. It makes the table harder to misread, makes the surrounding claims easier to check, and gives you a way to find out what happened instead of guessing.