A class timetable
Make a timetable table for three days (Monday, Tuesday, Wednesday) and four lessons, with a table title and a header. Let one lesson (e.g. "Computer science – double lesson") span two rows with rowspan.
Lists, class timetables and competition results are shown with lists and tables. This lesson also shows the semantic elements (header, nav, main, footer…) that divide a page into meaningful parts.
<h3>Unordered list (ul)</h3>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript
<ul><li>DOM</li><li>events</li></ul>
</li>
</ul>
<h3>Ordered list (ol)</h3>
<ol>
<li>Write the HTML</li>
<li>Add CSS</li>
<li>Bring it to life with JavaScript</li>
</ol>
Result:
ul (unordered) is a bulleted list, ol (ordered) a numbered list, and each item is an li. A list can be inside an item of another list. An ordered list has the attributes start="5" (from which number) and type="a" (letters instead of numbers). The navigation menus of websites are most often unordered lists of links.
<table border="1" cellpadding="6">
<caption>Results – municipal competition</caption>
<thead>
<tr><th>Name</th><th>Grade</th><th>Points</th></tr>
</thead>
<tbody>
<tr><td>Anna</td><td>7</td><td>300</td></tr>
<tr><td>Mark</td><td>7</td><td>245</td></tr>
<tr><td colspan="2">Average</td><td>272.5</td></tr>
</tbody>
</table>
Result:
| Element | Meaning |
|---|---|
table | the whole table |
caption | the title of the table |
thead / tbody | the head / body of the table |
tr | a row (table row) |
th | a header cell (bold, centred) |
td | an ordinary cell (table data) |
colspan / rowspan | a cell spans several columns / rows |
The attributes border and cellpadding are here only so that the table is visible without CSS; in real projects the look of a table is set with CSS. Tables are for data, not for laying out parts of a page – for layout you use CSS (flexbox and grid).
In the past all parts of a page were made of div elements. Today there are elements that say what each part is:
┌──────────────── header ─────────────────┐
│ logo, site title │
├──────────────── nav ────────────────────┤
│ Home | Projects | Contact │
├──────── main ─────────────┬── aside ────┤
│ section │ extra: │
│ article │ links, │
│ article │ ads │
├──────────────── footer ─────────────────┤
│ © 2026, contact │
└─────────────────────────────────────────┘
<header>
<h1>School code club</h1>
<nav>
<a href="#">Home</a> | <a href="#">Projects</a> | <a href="#">Contact</a>
</nav>
</header>
<main>
<article>
<h2>Our first website</h2>
<p>An article with its own heading and text.</p>
</article>
</main>
<footer>
<p>© 2026 Computer club</p>
</footer>
Result:
They look like ordinary blocks, but they help screen readers (the user can "jump" to the main content), search engines and you yourself when you read the code. The div element is still used – for grouping that has no special meaning, most often because of CSS. Its counterpart for a piece of text within a line is span.
| Block | Inline | |
|---|---|---|
| how it is placed | starts on a new line, takes the full width | stays in the line with the text, as wide as its content |
| examples | h1–h6, p, ul, ol, li, table, div, header, main, section | a, strong, em, span, img, code |
This difference matters for CSS: width and height are set on block elements, not on inline ones (more about this in the lesson The box model).
Each task has an example, a hint and a solution. The solutions have been checked in the browser.
Make a timetable table for three days (Monday, Tuesday, Wednesday) and four lessons, with a table title and a header. Let one lesson (e.g. "Computer science – double lesson") span two rows with rowspan.
Change the "About me" page from the first lesson so that it has a header with the title and navigation (an unordered list with three anchors), a main with three section elements and a footer.
li must be inside a ul or an ol.divs when a suitable semantic element exists.1. Which element makes a numbered list?
2. Which element is a table header cell?
3. Where is the main, unique content of a page?
4. What kind of element is span?