A first table
You never wrote <tbody>, but the browser added one. Delete the CSS tab to see a table's default look: no lines at all.
An HTML table is built row by row: <table> holds rows (<tr>), each row holds cells, and a cell is either a data cell (<td>) or a header cell (<th>) that labels other cells.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Build a 3-column table of three countries with their capital and continent, with a header row.
Make the country names row headers and add borders that show as single lines.
Explain it without notes
What is the difference between td and th, beyond how they look?
There is no column element in a basic table. How does a browser know which cells form a column?
What is foster parenting, and when does it happen?
When is a table the right choice for content?
Preview
Console
Nothing logged yet.Expected console output
Rows: 4
Cells in row 1: 3
tbody elements added by the browser: 1