Class 7 Computer Science — HTML lists and tables
Read an HTML list or table, count its items, rows and cells, and say which of its tags sits inside which.
Name: ________________________
Before you start
Every cell of this table has a name — find out what each one is called. Notice that the name says which row first, and only then how far along.
- 1. Row 1, cell 1
- 2. Row 1, cell 2
- 3. Row 1, cell 3
- 4. Row 2, cell 1
- 5. Row 2, cell 2
- 6. Row 2, cell 3
- 7. Row 3, cell 1
- 8. Row 3, cell 2
- 9. Row 3, cell 3
Every cell needs its own tag, and every row needs one as well — so a grid this size takes nine cell tags wrapped in three row tags, not nine tags on their own.
1.Match each tag to what one of it holds.
- <ul>
- <ol>
- <li>
- <tr>
- <td>
- A whole list with a bullet against each item
- One cell of a table
- One item of a list
- A whole list with a number against each item
- One row of a table
2.In “<ul><li>Red</li><li>Blue</li><li>Green</li><li>Black</li><li>White</li></ul>”, how many item tags are there altogether, counting the opening and closing tags separately?
3.How many rows does this table have: “<table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr><tr><td>5</td><td>6</td></tr></table>”?
4.In “<ol><li>Wash</li><li>Cut</li><li>Cook</li><li>Serve</li></ol>”, what number will the browser print beside Cook?
5.A recipe's steps have to be followed in a set order, and the reader needs to see which step is which. Which tag should wrap that list?
- a) <ul>
- b) <td>
- c) <ol>
- d) <li>
6.Which tag closes “<li>”?
7.How many cells does that same table hold altogether: “<table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr><tr><td>5</td><td>6</td></tr></table>”?
8.A table is built from 5 row tags, and each row holds 3 cell tags. How many cells is that altogether?
Answer key — Class 7 Computer Science — HTML lists and tables
- 1. <ul> → A whole list with a bullet against each item; <ol> → A whole list with a number against each item; <li> → One item of a list; <tr> → One row of a table; <td> → One cell of a table
- 2. 10
- 3. 3
- 4. 3
- 5. c) <ol>
- 6. </li>
- 7. 6
- 8. 15