HTML td Tag Interactive Tutorial Steps
Step 1: Table Data Cell Implementation
The <td> tag defines a table data cell. It goes inside <tr>. Use <th> for header cells (bold) and <td> for data. Each row should have the same number of cells (or use colspan/rowspan).
<td>
Step 2: Table Data Cell Implementation
Example: <table><tr><th>Name</th><th>Score</th></tr><tr><td>Alice</td><td>95</td></tr></table>. <td> holds the content of a cell. Use thead/tbody for structure. <th> vs <td>: th = header, td = data.
<tr>
<td>Alice</td>
<td>95</td>
</tr>
Step 3: Table Data Cell Implementation
colspan and rowspan: <td colspan="2"> spans two columns. <td rowspan="2"> spans two rows. Use headers attribute on <td> to list associated th ids for screen readers.
<td colspan="2">Merged</td>
Step 4: Table Data Cell Implementation
In the browser, <td> cells render as normal-weight text. <th> is bold by default. Keep rows consistent; use colspan/rowspan when you need merged cells.
<table><tr><th>Name</th></tr><tr><td>Alice</td></tr></table>
Step 5: Table Data Cell Implementation
Checkpoint: Which element represents a data cell (not a header) in a table?
<td>
Step 6: Table Data Cell Implementation
Correct! <td> is for data cells. <th> is for header cells. Both go inside <tr>. Use colspan and rowspan on <td> to merge cells.
<td>Data</td>
Step 7: Table Data Cell Implementation
You now know <td>. Complete the challenges below to master table data cells!