Skip to content

Commit 2fa99b7

Browse files
authored
fix(learn): wrap table rows in <tbody>
Firefox implicitly inserts \<tbody\> element to the table displayed on the page, while editable html doesn't include it. In the task you need to select every other row of the table without modifying html. One way to do that is to write following selector: ``` table > th:nth-child(2n + 1) { } ``` But because \<tr\> is wrapped in \<tbody\>, this selector doesn't work and it's not obvious why without looking in browser inspector. I just wrapped all rows in \<tbody\> so you can see it in editable html.
1 parent 647bfb4 commit 2fa99b7

File tree

1 file changed

+52
-48
lines changed

1 file changed

+52
-48
lines changed

learn/tasks/selectors/pseudo.html

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,32 @@
3333
<p>Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</p>
3434

3535
<table>
36-
<tr>
37-
<th>Fruits</th>
38-
<th>Vegetables</th>
39-
</tr>
40-
<tr>
41-
<td>Apple</td>
42-
<td>Potato</td>
43-
</tr>
44-
<tr>
45-
<td>Orange</td>
46-
<td>Carrot</td>
47-
</tr>
48-
<tr>
49-
<td>Tomato</td>
50-
<td>Parsnip</td>
51-
</tr>
52-
<tr>
53-
<td>Kiwi</td>
54-
<td>Onion</td>
55-
</tr>
56-
<tr>
57-
<td>Banana</td>
58-
<td>Beet</td>
59-
</tr>
36+
<tbody>
37+
<tr>
38+
<th>Fruits</th>
39+
<th>Vegetables</th>
40+
</tr>
41+
<tr>
42+
<td>Apple</td>
43+
<td>Potato</td>
44+
</tr>
45+
<tr>
46+
<td>Orange</td>
47+
<td>Carrot</td>
48+
</tr>
49+
<tr>
50+
<td>Tomato</td>
51+
<td>Parsnip</td>
52+
</tr>
53+
<tr>
54+
<td>Kiwi</td>
55+
<td>Onion</td>
56+
</tr>
57+
<tr>
58+
<td>Banana</td>
59+
<td>Beet</td>
60+
</tr>
61+
</tbody>
6062
</table>
6163
</div>
6264

@@ -71,30 +73,32 @@
7173
<p>Veggies es <a href="http://example.com">bonus vobis</a>, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.</p>
7274
<p>Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</p>
7375
<table>
74-
<tr>
75-
<th>Fruits</th>
76-
<th>Vegetables</th>
77-
</tr>
78-
<tr>
79-
<td>Apple</td>
80-
<td>Potato</td>
81-
</tr>
82-
<tr>
83-
<td>Orange</td>
84-
<td>Carrot</td>
85-
</tr>
86-
<tr>
87-
<td>Tomato</td>
88-
<td>Parsnip</td>
89-
</tr>
90-
<tr>
91-
<td>Kiwi</td>
92-
<td>Onion</td>
93-
</tr>
94-
<tr>
95-
<td>Banana</td>
96-
<td>Beet</td>
97-
</tr>
76+
<tbody>
77+
<tr>
78+
<th>Fruits</th>
79+
<th>Vegetables</th>
80+
</tr>
81+
<tr>
82+
<td>Apple</td>
83+
<td>Potato</td>
84+
</tr>
85+
<tr>
86+
<td>Orange</td>
87+
<td>Carrot</td>
88+
</tr>
89+
<tr>
90+
<td>Tomato</td>
91+
<td>Parsnip</td>
92+
</tr>
93+
<tr>
94+
<td>Kiwi</td>
95+
<td>Onion</td>
96+
</tr>
97+
<tr>
98+
<td>Banana</td>
99+
<td>Beet</td>
100+
</tr>
101+
</tbody>
98102
</table>
99103
</div>
100104
</textarea>

0 commit comments

Comments
 (0)