Lists and tables in HTML

Bulleted, numbered and description lists, how to nest them, then tables: rows, cells, headers, merged cells and the role of each tag.

  • 25 cards
  • 5 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. The numbers
  5. Scenarios

A few cards from the deck

  • Unordered list: what is it?

    Show the answer

    A list whose item order does not matter, written with <ul> containing <li>; displayed with bullets.

    Bullets are only the default look: a navigation menu is also a ul, without bullets thanks to CSS.

  • Why is this code invalid?

    ```html
    <ul>
    <li>Fruits</li>
    <ul>
    <li>Pomme</li>
    </ul>
    </ul>
    `

    • The sublist is a child of ul: it must be inside the li
    • A list can never contain another one
    • The sublist should be an ol
    • The sublist is missing a type attribute
    Show the answer

    The sublist is a child of ul: it must be inside the li

    The only direct children of ul and ol are li. To nest, the sublist goes inside the li it details: <li>Fruits<ul><li>Apple</li></ul></li>.

  • In a table, the … tag creates a row, the … tag a header cell and the … tag a data cell.

    Show the answer

    In a table, the tr tag creates a row, the th tag a header cell and the td tag a data cell.

    tr for "table row", th for "table header", td for "table data". Cells always go inside a row, never directly in table.

  • Ordered list: what is it?

    Show the answer

    A list whose order matters, written with <ol> containing <li>; the items are numbered by the browser.

    Never type the numbers yourself: inserting a step renumbers the rest. The start and reversed attributes change the starting point and the direction.