HTML

Lists and Tables

Master complex data presentation using nested lists, description lists, and accessible, responsive data tables.

By TechCoder TeamLast updated: 2026-06-02
In a Nutshell

Master complex data presentation using nested lists, description lists, and accessible, responsive data tables. This hands-on tutorial focuses on practical implementation of lists and tables concepts.

Lists and Tables

In this module, we move beyond simple text and explore how to organize complex data logically. Whether you are building a navigation menu or a pricing comparison, lists and tables are your core tools.

Lesson Path


1. Unordered and Ordered Lists

You've likely seen these before, but professional HTML uses them for more than just bullet points.

  • Unordered (<ul>): Used for sets of items where the order doesn't change the meaning (e.g., navigation links, social icons).
  • Ordered (<ol>): Used for sequential steps where the number matters (e.g., code execution steps, recipe instructions).

Pro Tip: Nested Lists

You can place a list inside another list to create sub-menus or hierarchical outlines.

<ul>
  <li>Frontend
    <ul>
      <li>HTML</li>
      <li>CSS</li>
    </ul>
  </li>
  <li>Backend</li>
</ul>

2. Description Lists (<dl>)

Often overlooked, the Description List is perfect for key-value pairs, metadata, or glossaries.

  • <dl>: The wrapper.
  • <dt>: The Term (the key).
  • <dd>: The Description (the value).
<dl>
  <dt>HTML</dt>
  <dd>HyperText Markup Language - the structure of the web.</dd>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets - the styling of the web.</dd>
</dl>

3. Accessible Data Tables

Tables should only be used for tabular data (like spreadsheets), never for layout. A pro-grade table includes structural elements that help screen readers.

Core Table Anatomy:

  1. <thead>: Wraps the header row.
  2. <tbody>: Wraps the main data.
  3. <tfoot>: Wraps summary data (totals, etc.).
  4. <th>: Header cell (use scope="col" or scope="row" for clarity).

Interactive Demo

Pricing Comparison Table

Build a high-end pricing table. Notice how we use the 'scope' attribute and 'caption' to make the table accessible to screen readers.

39 lines28 tags
Table StructureDescription ListsAccessibility Scope
HTML PLAYGROUND
⏳ Loading editor…
Live Preview
Real browser rendering