Data presentation requires absolute structural clarity. HTML tables are not mere visual grids; they are accessible, programmatic matrices that allow machines to parse and interpret complex relationships between data points.
1The Foundational Grid
A table is built layer by layer. The root <table/> tag initiates the matrix. Within this wrapper, you construct horizontal rows using the <tr> (Table Row) tag. Inside these rows, you inject the actual data payloads using the <td> (Table Data) tag.
This explicit nesting structure (table > row > data) guarantees that browsers and assistive technologies can mathematically calculate the exact grid position (X, Y coordinates) of every single piece of information.
2Semantic Row Grouping
Large datasets require semantic compartmentalization. By splitting your table into <thead> (the header row group), <tbody> (the primary data payload), and <tfoot> (the summary row group), you give the browser immense contextual power.
This grouping isn't just for organization; it allows the browser to independently scroll the <tbody> while keeping the <thead> pinned to the top, and it explicitly informs screen readers which section of the data they are currently parsing.
3Merging and Spanning Cells
Strict 1:1 grids are rare in complex applications. When a single data point or label needs to stretch across multiple columns or rows, you deploy the colspan and rowspan attributes.
Applying colspan="3" instructs the browser's rendering engine to merge the current cell horizontally across three structural columns, automatically adjusting the layout of the adjacent cells. This is heavily used for top-level overarching labels or 'No Data Found' empty states.
