Sub topic 8
Use Tables for Comparisons Across Attributes
Assume you know basic HTML and have edited web content for search engines. A comparison table is useful when readers need to compare the same attributes across several items. Semantic table markup gives browsers, assistive technology, search systems, and AI answer systems clearer relationships between labels and values.
What information belongs in a table?
Use a table when each row represents one item and each column represents one shared attribute. For example, a hosting-plan comparison can show price, storage, and support for every plan.
A table is not a replacement for explanation. Introduce the comparison in a paragraph, then use the table for compact facts. Define terms that readers may not know before or after the table.
| Format | Best for | Example |
|---|---|---|
| Paragraph | Explaining one subject in context | Why a plan suits a small team |
| Unordered list | Showing related features | Included integrations |
| Ordered list | Showing actions in sequence | Steps to upgrade |
| Table | Comparing shared attributes | Price and storage by plan |
Keep the table focused. If every cell contains a long paragraph, the table becomes difficult to scan and difficult for a retrieval system to quote accurately. Move detailed explanations into sections below the table and link to them when needed.
How should you mark up a comparison table?
Use the HTML table element for data, caption for the table's purpose, thead for column headings, tbody for data rows, and th elements for headers. Add scope="col" to column headers and scope="row" to row headers.
<table>
<caption>Plans compared by monthly price, storage, and support</caption>
<thead>
<tr>
<th scope="col">Plan</th>
<th scope="col">Monthly price</th>
<th scope="col">Storage</th>
<th scope="col">Support</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Starter</th>
<td>$10</td>
<td>50 GB</td>
<td>Email</td>
</tr>
<tr>
<th scope="row">Team</th>
<td>$40</td>
<td>500 GB</td>
<td>Email and chat</td>
</tr>
</tbody>
</table>The caption states what the table compares. The header cells identify the meaning of each value. A row header identifies the item described by the remaining cells. This explicit structure is more reliable than using visual styling, spacing, or bold text to imply relationships.
Why does this structure help retrieval?
AI answer systems often retrieve a passage or content segment rather than understanding an entire page at once. A table can be split from its introduction, so its caption and column headers should provide enough context to interpret the values.
Prefer complete labels such as “Monthly price” instead of “Price.” Use units in the header, such as “Storage (GB),” or use them consistently in every cell. Avoid unexplained symbols such as a lone check mark. Write “Included” or “Not included” when that wording makes the comparison clearer.
A useful table lets a reader answer one question without guessing:
- Which plan costs less?
- How much storage does each plan include?
- Which plans provide chat support?
Do not assume that a table guarantees that an AI system will cite your page. Retrieval, ranking, formatting, and answer generation depend on the system and the user's question.
When should you use another format?
Use prose when the relationship is explanatory rather than comparative. Use an unordered list for a set of features with no meaningful order. Use an ordered list when changing the order would change the result. Use a table when the same attributes repeat across multiple items.
What table mistakes reduce clarity?
Avoid these patterns:
- Using a table only for visual layout.
- Omitting a caption when the table could be separated from its surrounding text.
- Leaving column headers vague or empty.
- Combining cells with
colspanorrowspanwhen simple one-value cells would be clearer. - Mixing units, such as dollars in one row and percentages in another.
- Sorting rows without stating the rule when the order affects interpretation.
- Repeating “yes” and “no” without naming what they refer to.
- Putting several unrelated comparisons into one oversized table.
After writing the table, read each row from left to right. Ask whether every value can be understood from the caption and headers alone. Then check the table on a narrow screen and with a keyboard or screen reader.
Exercise
A page compares three camera models by price, weight, and battery life. Should the comparison use a table, an unordered list, or an ordered list?
Show answer
Use a table because each model has the same repeated attributes. Mark the model names as row headers and label every attribute column.