Text outside a cell is moved above the table
The stray sentence was written after the row, yet it appears above the table. This is foster parenting.
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
Text inside the table: I am inside a cell
Text just before the table: Oops, I am not in a cell