Let's build a small table and read its structure from top to bottom.
- <table> is the outer container for the table. - <caption> gives the table a visible description or title when one is useful. - <thead> groups the header rows. - <th> represents a header cell, such as Name or Age. - <tbody> groups the main data rows. - <td> represents an ordinary data cell. - Each <tr> creates one table row. - Keep the number and meaning of cells consistent so the rows line up correctly. - For accessible tables, use clear headers and consider the scope attribute on header cells. - colspan and rowspan can make one cell span multiple columns or rows, but use them only when the data really has that relationship.
A table is for related data that naturally fits rows and columns. It is not a general page-layout tool.
