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.
- Concepts
- Questions
- Sort and link
- The numbers
- 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 theli - A list can never contain another one
- The sublist should be an
ol - The sublist is missing a
typeattribute
Show the answer
The sublist is a child of
ul: it must be inside theliThe only direct children of
ulandolareli. To nest, the sublist goes inside theliit details:<li>Fruits<ul><li>Apple</li></ul></li>.- The sublist is a child of
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.
trfor "table row",thfor "table header",tdfor "table data". Cells always go inside a row, never directly intable.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
startandreversedattributes change the starting point and the direction.