The assignment errors are saying that I need 5 table row elements in my table but supposedly I have 6. I’ve went through on zyBooks and Sublime text, I’m only seeing 5. Can anyone else see what’s going on and why it’s saying I have too many table row elements?
I’ve counted the elements over and over and over in the application itself and on Sublime Text.
<body>
<table>
<tr>
<caption>Red Rocks, Colorado</caption>
<th>Photo</th>
<th>Date</th>
<th>Description</th>
</tr>
<tr>
<td>
<img src="https://via.placeholder.com/50" alt="View from the top row; sitting area holds 9,525 people">
</td>
<td>Jan 16,2018</td>
<td>View from the top row; sitting area holds 9,525 people</td>
</tr>
<tr>
<td>
<img src="https://via.placeholder.com/50" alt="Facing south from the top of the amphitheater">
</td>
<td>Feb 20, 2017</td>
<td>Facing south from the top of the amphitheater</td>
</tr>
<tr>
<td>
<img src="https://via.placeholder.com/50" alt="Nearby red rocks sit 6,450 feet (1,970m) above sea level">
</td>
<td>Mar 30, 2019</td>
<td>Nearby red rocks sit 6,450 feet (1,970m) above sea level</td>
</tr>
<tr>
<td colspan="5">Copyright @ 2023 Zippy Photographers</td>
</tr>
</table>
</body>
I’m currently reformatting since zyBooks sucks at that. Hopefully that will help.
2
Answers
You’ve misapplied the
caption
element.By including it in a row, you force the browser to guess at what valid HTML you intended. It’s wrapping the caption in a separate
tbody
element (which your table lacks). Your assignment analyzer may be interpreting it as another row.Be sure to peruse the docs for every element you use so you understand its purpose and its constraints. They’re not to be used arbitrarily.
Then, look into how to examine your page with your browser’s document inspector. It’s an invaluable tool for troubleshooting and would’ve given you hints to the reason for this problem.
You are missing
<thead>
<tbody>
<tfoot>
elementsand
<caption>
element should be independent (not inside a<tr>
!)