New! Explore our Programming Academy and AI Tutor - learn to code from scratch, free to start. Explore Now
Programming HTML HTML Lists and Tables

HTML Lists and Tables

🌐 HTML

Create ordered lists, unordered lists, and tables.

Lesson 5 of 7 Tutorial
0/7 completed

Lists and Tables

Unordered List (bullet points)

<ul>
    <li>HTML</li>
    <li>CSS</li>
    <li>JavaScript</li>
</ul>

Ordered List (numbered)

<ol>
    <li>First step</li>
    <li>Second step</li>
    <li>Third step</li>
</ol>

Tables

<table>
    <thead>
        <tr><th>Name</th><th>Age</th></tr>
    </thead>
    <tbody>
        <tr><td>Alice</td><td>25</td></tr>
        <tr><td>Bob</td><td>30</td></tr>
    </tbody>
</table>

Example

<!DOCTYPE html>
<html>
<head><title>Lists & Tables</title></head>
<body>
    <h1>Shopping List</h1>
    <ul>
        <li>Milk</li>
        <li>Bread</li>
        <li>Eggs</li>
    </ul>

    <h1>Student Scores</h1>
    <table border="1">
        <tr>
            <th>Name</th>
            <th>Score</th>
        </tr>
        <tr>
            <td>Alice</td>
            <td>95</td>
        </tr>
        <tr>
            <td>Bob</td>
            <td>88</td>
        </tr>
    </table>
</body>
</html>

Exercises

Exercise 1. An Unordered List of Snacks Easy
Write an unordered list (<ul>) of snacks containing exactly three items: Biscuit, Chin Chin, Orange.
Use the exact text shown in the lesson.
<ul>
    <li>Biscuit</li>
</ul>
Expected Output
• Biscuit
• Chin Chin
• Orange

Lesson Nav

Lesson sections