Use HTML <table> for information whose rows and columns have meaningful relationships—such as comparing prices, schedules, or measurements. Mark labels with <th>, values with <td>, and give the table a clear <caption>. For page layout, use CSS instead.
What is an HTML table?
The <table> element represents tabular data: information arranged in two dimensions through rows, columns, and data cells. A useful test is whether readers need to compare values across rows and columns because those values have a logical relationship. A schedule or product comparison fits; a sidebar placed beside an article does not.
The WHATWG HTML Living Standard places tables in its tabular-data section. The W3C Web Accessibility Initiative (WAI) Tables Tutorial focuses on data tables, not layout tables, and recommends CSS for visual presentation. This is a distinction about purpose and semantics: CSS can style a data table, but a table should not be used as a general-purpose page-layout grid.
When should you use a table?
Use a table when each cell’s meaning depends on its row, column, or both. For example, in a weekly timetable, a reader may need to connect a day with a time slot; in a price comparison, a reader may compare the same feature across several options. The shared row-and-column structure makes those relationships easier to inspect.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Use CSS layout tools when the goal is arranging page regions—such as placing navigation next to content—even if the result visually resembles a grid. Visual appearance alone does not make information tabular.
What are the parts of an HTML table?
A table can contain a caption, column groups, row groups, rows, and cells. Not every table needs every element. The HTML Standard allows an optional <caption>, zero or more <colgroup> elements, an optional <thead>, body rows grouped in one or more <tbody> elements or written as rows, and an optional <tfoot>, subject to the standard’s content model.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
| Element | Role |
|---|---|
<table> |
Contains the table structure and its data. |
<caption> |
Names or labels the table; place it directly inside <table>. |
<colgroup> |
Groups columns structurally; it does not establish which headers describe a cell. |
<thead> |
Groups header rows. |
<tbody> |
Groups the main body rows. |
<tfoot> |
Groups footer rows, often containing totals or related summary data. |
<tr> |
Represents a row of cells. |
<th> |
Represents a header cell. |
<td> |
Represents a data cell. |
These group elements help organize content and can assist styling or scripting, but using <thead> or <tbody> by itself does not establish accessible header relationships. Also, browsers can supply a <tbody> in some cases when parsing markup, so the parsed structure may include a body group even when the author did not write one explicitly.
How do you make an HTML table accessible?
Use semantic header and data cells, name the table, and make clear which headers apply to which data. The WAI Tables Tutorial states: “Header cells must be marked up with <th>, and data cells with <td> elements to make tables accessible.” Bolding a label or placing it at the top of a column does not, by itself, convey that role to software.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Give the table a useful caption
Put a concise <caption> directly inside the table to identify its subject. A caption helps readers locate a table and decide whether to navigate into it. The HTML Standard notes, “A caption can introduce context for a table, making it significantly easier to understand.” Avoid captions so vague that they do not distinguish the table from nearby content.
For a complex table, a summary can explain how its structure is organized. WAI says summaries are usually needed only for complex tables. If you provide both a caption and a summary, make them serve distinct purposes rather than repeating the same information. See WAI’s Caption & Summary guidance.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Mark column and row headers
Use <th> for the cells that label columns or rows, and <td> for the corresponding data. If a table has a clear header row and no competing row-header direction, the column labels should be header cells. If the first column names each row, those labels should also be header cells.
When a table has both row and column headers, add a scope attribute to make the direction explicit. Use scope="col" for a header applying to a column and scope="row" for a header applying across a row. WAI explains this pattern in its Tables with Two Headers tutorial.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteBest Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
<table>
<caption>Weekly support hours</caption>
<thead>
<tr>
<th scope="col">Day</th>
<th scope="col">Opening time</th>
<th scope="col">Closing time</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Monday</th>
<td>9:00 a.m.</td>
<td>5:00 p.m.</td>
</tr>
</tbody>
</table>
Here, “Day,” “Opening time,” and “Closing time” label columns; “Monday” labels its row. The caption gives the table an identifying name.
Handle grouped or irregular headers deliberately
Some tables have headers spanning multiple columns or rows, or cells whose meaning depends on several headers at once. For grouped headers, scope="colgroup" and scope="rowgroup" can express group relationships. For complex or non-linear associations, give each relevant <th> an id, then list the applicable IDs in the data cell’s headers attribute. WAI describes these approaches in its Tables with Irregular Headers tutorial.
Explicit associations are more detailed to author and maintain, so first ask whether the information can be represented as smaller, related tables with simpler header relationships. MDN cautions that assistive technologies may have difficulty with associations that cannot be understood strictly horizontally or vertically, and suggests considering smaller tables. If one complex table is necessary, encode its relationships explicitly rather than relying on visual position alone. No single browser-and-assistive-technology behavior should be assumed for every table structure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Which header-association method should you choose?
| Table structure | Approach | When it helps |
|---|---|---|
| Simple, clearly oriented headers | Use <th> for headers and <td> for data. |
The header relationships are straightforward from the table’s structure. |
| Distinct row and column headers | Add scope="row" and scope="col". |
Explicit direction clarifies which row or column each header governs. |
| Headers for row or column groups | Use scope="rowgroup" or scope="colgroup" where appropriate. |
A header applies to a group rather than only a single row or column. |
| Multiple or non-linear header associations | Assign IDs to header cells and refer to them from data cells with headers. |
A data cell needs associations that cannot be conveyed clearly by a simple row or column direction. |
| Structure is hard to follow | Consider splitting the content into smaller related tables. | A simpler structure may reduce the effort needed to understand the relationships. |
The table element and its semantics are defined in the WHATWG HTML Standard; MDN’s table-element reference provides an additional overview. For a specific support guarantee, check current compatibility information for the relevant browser and assistive technology; broad guidance is not a compatibility matrix.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Common table-markup mistakes
- Using a table to arrange page regions: choose CSS layout tools when the content does not have row-and-column data relationships.
- Using styled text as a header: mark actual headers with
<th>, not only bold text or visual placement. - Leaving the table unnamed: add a meaningful caption so readers can identify its subject.
- Assuming row groups define header meaning:
<thead>,<tbody>, and<tfoot>organize rows; header cells and associations communicate which labels apply to data. - Forcing a complicated grid into one table: where simpler related tables preserve the information, consider them before adding many cross-references.
For another standards-based explanation of using table markup for tabular information, see W3C’s H51 technique.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

