HTML Tables
A table is for information arranged in rows and columns. Think about a class timetable or a price list. <table> creates the table. <tr> creates a row. <th> creates a heading cell. <td> creates a normal data cell. A simple table might have a header row with Name and Age, followed by rows containing real values. Tables are for data, not for building the layout of a whole web page. Modern page layout belongs to CSS.
Why this matters
- ·Tables make structured data easy to compare.
- ·Header cells tell readers what each column means.
- ·A clear table is easier to read and maintain.
Common mistakes
- ·Using tables for page layout creates difficult code.
- ·Rows with missing cells can make data confusing.
- ·Large tables need careful headings and accessibility support.
Advertisement
Your codeHTML
Live preview
Advertisement
Frequently asked questions
Table row.
Advertisement
Practice questions
Question 1
Create a two-column table with three data rows.
Your codeHTML
Live preview
Question 2
Create a table showing three products and prices.
Your codeHTML
Live preview
Quick check
Just for this topic answer honestly, then check yourself.
1 / 3
