<table> <tr> <td>Apple</td> <td>Banana</td> </tr> <tr> <td>Cherry</td> <td>Date</td> </tr> </table>
The <tr> tag creates a table row. There are 2 <tr> tags, so 2 rows. Each row has 2 <td> cells, so 2 columns.
The <th> tag defines a header cell in a table. It is bold and centered by default. <td> is for regular cells, <tr> is for rows, and <thead> groups header rows.
table tr td:nth-child(2) selects the second <td> inside each <tr>, which means the second column cells. Option B selects the second <td> of the whole table, not per row. Option B selects all cells in the second row. Option B selects all <td> that are second child of their parent, but without tr context it may select incorrectly.
table-layout: fixed; forces the table to divide width evenly among columns. Setting width: 100% makes the table fill its container. Other options do not evenly space columns: width: auto sizes columns by content, border-collapse affects borders, and display: flex is invalid for tables.
<td> elements?The headers attribute on <td> elements contains a space-separated list of id values of <th> elements that act as headers for that cell. This helps screen readers associate data cells with their headers in complex tables. aria-labelledby is similar but less specific for tables. scope is used on <th> to define header scope. role defines element roles but does not link headers to cells.