I have added table rows, but I'm getting a message saying I did not


#1

https://www.codecademy.com/courses/learn-html-tables/lessons/tables/exercises/table-rows?action=resume_content_item&course_redirect=learn-html

OK, I’m not sure I put this in the right category, because the course I’m doing is just called “Learn HTML”, and I can’t find that specified in the category selections… So I hope I got that right! :slight_smile:

I’m having the same problem mentioned here (Tables lesson 3 rows).

No matter where or how many times I add two rows to a table, I get this error: “Did you add two rows?”

This is what I’m adding between

:
<tr>
</tr>
<tr>
</tr>

The suggested solution in the thread I’ve linked to above seemed to be to look for another table, but I’ve tried this in every table in the code, so I’m not sure why it’s not allowing me to pass. I don’t know if that was the solution, either, since the thread doesn’t appear to have been resolved.

Can someone help me figure this out?

Thanks!

P. S. Here’s the whole code, if that helps:

<!DOCTYPE html>
<html>
<head>
  <title>Ship To It - Company Packing List</title>
  <link href="https://fonts.googleapis.com/css?family=Lato: 100,300,400,700|Luckiest+Guy|Oxygen:300,400" rel="stylesheet">
  <link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>

  <ul class="navigation">
    <li><img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-9/htmlcss1-img_logo-shiptoit.png" height="20px;"></li>
    <li class="active">Action List</li>
    <li>Profiles</li>
    <li>Settings</li>
  </ul>
	<table>
    <tr>
    </tr>
    <tr>
    </tr>
  </table>
  <div class="search">Search the table</div>
	<table>
    <thead>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    	<th scope="col">Company Name</th>
      <th scope="col">Number of Items to Ship</th>
      <th scope="col">Next Action</th>
    </tr>
    </thead>
    <tbody>
		<tr>
      <td colspan="2">Adam's Greenworks</td>
      <td>14</td>
      <td>Package Items</td>
    </tr>
    <tr>
  <td>Davie's Burgers</td>
  <td>2</td>
  <td>Send Invoice</td>
</tr>
<tr>
  <td>Baker's Bike Shop</td>
  <td rowspan="2">3</td>
  <td>Send Invoice</td>
</tr>
<tr>
  <td>Miss Sally's Southern</td>
  <td>4</td>
  <td>Ship</td>
</tr>
<tr>
  <td>Summit Resort Rentals</td>
  <td>4</td>
  <td>Ship</td>
</tr>
<tr>
  <td>Strike Fitness</td>
  <td>1</td>
  <td>Enter Order</td>
</tr>
</tbody>
<tfoot>
  <td>Total</td>
	<td>28</td>
</tfoot>
  </table>
  
</body>
</html>

#3

Try adding those rows to the data section (tbody) instead of the header (thead).


#4

This time I put it right below the opening tbody tag. I’m getting the same error message, although I’ve also tried putting it in a few other places inside the table, including right above the closing tbody and right after the first row that has data in it.

Any other ideas?

Thanks!

<!DOCTYPE html>
<html>
<head>
  <title>Ship To It - Company Packing List</title>
  <link href="https://fonts.googleapis.com/css?family=Lato: 100,300,400,700|Luckiest+Guy|Oxygen:300,400" rel="stylesheet">
  <link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>

  <ul class="navigation">
    <li><img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-9/htmlcss1-img_logo-shiptoit.png" height="20px;"></li>
    <li class="active">Action List</li>
    <li>Profiles</li>
    <li>Settings</li>
  </ul>

  <div class="search">Search the table</div>
	<table>
    <thead>
    <tr>
    	<th scope="col">Company Name</th>
      <th scope="col">Number of Items to Ship</th>
      <th scope="col">Next Action</th>
    </tr>
    </thead>
    <tbody>
      <tr></tr>
      <tr></tr>
		<tr>
      <td colspan="2">Adam's Greenworks</td>
      <td>14</td>
      <td>Package Items</td>
    </tr>
    <tr>
  <td>Davie's Burgers</td>
  <td>2</td>
  <td>Send Invoice</td>
</tr>
<tr>
  <td>Baker's Bike Shop</td>
  <td rowspan="2">3</td>
  <td>Send Invoice</td>
</tr>
<tr>
  <td>Miss Sally's Southern</td>
  <td>4</td>
  <td>Ship</td>
</tr>
<tr>
  <td>Summit Resort Rentals</td>
  <td>4</td>
  <td>Ship</td>
</tr>
<tr>
  <td>Strike Fitness</td>
  <td>1</td>
  <td>Enter Order</td>
</tr>
</tbody>
<tfoot>
  <td>Total</td>
	<td>28</td>
</tfoot>
  </table>
  
</body>
</html>


#5

Because the SCT has limited error messages, sometimes the actual error that causes the problem is not what the message suggests. The above code is invalid since it is missing the <tr></tr> to wrap the TD elements.


#6

I tried adding the tr tags around that, but it didn’t seem to help. I kept trying various things until it offered me the solution, so I just took that and moved on.

I have a fairly good grasp on HTML already (just taking this course over again as a refresher), but tables have always been something I had trouble with, so probably I just missed a detail somewhere. Maybe I’ll have another look, but I’m willing just to let the issue drop.

Thanks for your help!


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.