In this lesson you will
- Pick the right list type for the content
- Build a data table with headers screen readers understand
- Know when a table is the wrong tool
Three kinds of list
An unordered list, <ul>, is for items where the order does not change the meaning, such as features or ingredients. An ordered list, <ol>, is for steps, rankings or anything where position matters; the browser numbers it for you. Each item in either list is an <li>, and only <li> elements can be direct children of ul and ol.
<ol> has useful attributes: start="5" begins counting at 5, reversed counts down, and type="a" or type="i" uses letters or Roman numerals. Lists can nest: put a whole new <ul> inside an <li>, never directly inside the parent list.
A description list, <dl>, pairs terms with descriptions: <dt> is the term and <dd> its description. It suits glossaries, FAQs and key-value details such as "Opening hours: 9 to 5".
Console
- Console messages, errors, form data and clicked links appear here.
Add start="3" to the ol and watch the numbers change.
Sign in free to read the full lesson
You are reading the free preview. Create a free account (it takes one minute, no password) to unlock the rest of this lesson and track your progress.
Unlocks after sign-in:
- 2 more sections with live code examples
- Common mistakes to avoid
- Hands-on coding exercise with automatic checks
- Practice quiz and the graded lesson test
Free forever. No card, no paywall.
Questions people ask
Can I change the bullet style of a list?
Yes, with CSS: list-style-type sets circles, squares, numbers or none, and ::marker styles the bullet itself. Keep the ul/ol element either way, because the meaning stays the same.
Do Arabic pages number lists right to left?
With dir="rtl", bullets and numbers move to the right side automatically. Numbers stay Western digits unless you set list-style-type: arabic-indic in CSS.
Is it okay to use a table for a calendar?
Yes. A month calendar is real tabular data: days of the week are column headers and each week is a row.
How do I make a table sortable?
HTML alone cannot sort. You add a small JavaScript function that reorders rows when a header button is pressed; the JavaScript course covers it. Keep the headers as <th> and put a <button> inside them.
What is the difference between thead and th?
<thead> groups the header rows of the table. <th> is a single header cell and can appear anywhere, for example as the first cell of each body row.
Sources
Facts in this lesson were checked against these official pages on 20 October 2026.
Code examples stay in English and run in a sandbox on your device. If you spot a mistake, tell us through the contact page.