FAQ: Learn HTML - Tables - Table Body

This community-built FAQ covers the “Table Body” exercise in Codecademy’s lessons on HTML.

Here are the most popular community questions on this exercise:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about HTML in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

2 posts were split to a new topic: How can you indent multiple lines all at once?

In the Table Body exercise, the site states " The <tbody> element should contain all of the table’s data, excluding the table headings (more on this in a later exercise)." excluding, but then it proceeds to use the <th> tag within the <tbody> tag. Is this just a mistype, or is there an explanation why in the example we’re allowed to use the <th> tag within the <tbody> tag? If we genuinely aren’t allowed to include the <th> within the <tbody> tags, where would we put them?

1 Like

Data columns and rows can have headings, too, hence TH is used in the first row and the first column, instead of TD. When TH is used in the THEAD, it usually spans the entire table as a single, main heading for the table.

1 Like

The exercise says: Enclose rows 2, 3, 4, 5, and 6 of the table in a <tbody> element.

However, the table does not have that many rows.

5 Likes

Funny, I count eight rows in all.

1 Like

This was my issue too. I don’t think this task is particularly clear for anyone who is anyone who is a true beginner.

I think this task could’ve been explained a little clearer. I don’t see anything other on my screen than the cells we just created in the previous task, and as an absolute beginner wasn’t sure if we’re suppose to find the 6 rows from the code or the ones we see on the page. I just got it right but it still doesn’t make much sense to me yet.

3 Likes

This exercise says Enclose rows 2, 3, 4, 5, and 6 of the table in a tbody element. However, the row whose company’s name in Strike Fitness is the 7th row, isn’t that part of the tbody

1 Like

Yes, it should be. What do the instructions say about the last row (Total)?

Well, at the point of this exercise there’s no row of total yet, so I guess it shouldn’t matter

If <tbody> element section off the table… So why we can’t see any modification (visualisation) ?

TBODY is much like DIV. It has 100% of the width of the TABLE and zero height until it is populated. There is nothing to visualize since there is no border. It is just a container.

2 Likes

I missed this, too! And came to this FAQ to find what the exercise was talking about. Turns out I missed an instruction from lesson 6 of 13 (Table Borders). In that lessons, the bottom instructions tell you add the additional rows to your code. Copypaste, click run, and the code will stay when you go back to the Table Body lesson

2 Likes

Sorry, but this tbody exercise was confusing.

“Enclose rows 2, 3, 4, 5, 6, and 7 of the table in a <tbody> element.”

Is rather vague. I am so glad this website is free because I would be asking for my money back because of how some of these instructions are worded. They speak as though we have been coding for years. I STILL don’t know what the heck I am doing half the time because of these instructions. I read them, re-read them and re-re-read them and they will confuse the heck out of me.

I “enclosed” the LITERAL rows 2-7 and it was wrong. Then I went down to where I saw “table” and I tried enclosing there, which were NOT rows 2-7 (like I said, confusing!) and that was wrong. So I decided to skip this one and see the answer. WHOEVER wrote this needs to go back and make it more user friendly for people who HAVE NEVER CODED IN THEIR LIFE!

It’s great that you authors know this stuff already, but you’re not really good teachers, I’m sorry to say. If you mean to confuse your students, then you are indeed succeeding in that area. MAKE IT MORE SIMPLE!

2 Likes

Hey, there. I’m a little confused by the colspan and rowspan attributes for cells: Whenever I use these span attributes, they end up pushing the row below it outside of the table’s boundary. Is there a way to allow for a rowspan without the row below it being pushed out? I’m guessing that I’d have to apply the same rowspan amount to all of the cells within that row to prevent the row below it from looking pushed out?

<table>
    <tr>
      <th scope="col">Company Name</th>
      <th scope="col"> Number of Items to Ship</th>
      <th scope="col">Next Action</th>
    </tr>
    <tr>
      <td>Adam's Greenworks</td>
      <td>14</td>
      <td>Package Items</td>
    </tr>
    <tr>
      <td rowspan="2">Davie's Burgers</td>
      <td>2</td>
      <td>Send Invoice</td>
    </tr>
    <tr>
      <td>Baker's Bike Shop</td>
      <td>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>
  </table>

I feel the same too, its to confuse. I don’t undertand.