Learn to Code
All tracks
Learn to Code

Free lessons from scratch to pro — every language, databases and DevOps.

AboutContactPrivacy PolicyTerms of Use

Your progress is saved in this browser. © 2026 Learn to Code

HTML
HTML
0/10 completed
Beginner
Your first web pageText, links and imagesLists and tablesForms
Intermediate
Semantic HTMLAccessibility basicsSEO and meta tags
Advanced
Images, video and embedsModern HTML: dialog, details and more
Pro
Performance and best practices
Tracks / HTML / Beginner

Lists and tables

Lists and tables organise information so it's easy to scan. Navigation menus, shopping lists, step-by-step instructions and price comparisons are all built with them.

Unordered lists

Use <ul> when order doesn't matter. Each item is an <li> (list item).

HTML · CSS · live preview
Preview

Ordered lists

Use <ol> when the sequence matters: steps, rankings, instructions.

HTML · CSS · live preview
Preview

Nested lists

Put a whole new list inside an <li>:

HTML · CSS · live preview
Preview

Description lists

For term–definition pairs, like glossaries or FAQs:

HTML · CSS · live preview
Preview

Navigation menus are usually a <ul> of links inside a <nav>. CSS then lays them out horizontally.

Tables

Tables are for tabular data: information with rows and columns. They're not for page layout (that was a 1990s hack; we use CSS now).

HTML · CSS · live preview
Preview
Element Meaning
<table> The table
<caption> Its title (helps accessibility)
<thead>, <tbody>, <tfoot> Header, body and footer row groups
<tr> A table row
<th> A header cell (bold and centred by default)
<td> A data cell

(border="1" is just to make the lines visible here. In real projects, style borders with CSS.)

Spanning rows and columns

HTML · CSS · live preview
Preview

scope="col" and scope="row" tell screen readers which cells a header describes.

Practice

Build a weekly timetable table with days as columns and 3 time slots as rows, using <thead>, <tbody> and at least one colspan. Then add an ordered list of your 3 study goals below it.

HTML · CSS · live preview
Preview
✎ Check your understanding

1.Which list should you use for recipe steps?

2.Should you use tables to lay out a page's columns?

← Text, links and images