Why do I only see one row even though my table contains two sets of `<tr>` tags?

Question

After completing step 1 of this exercise, why do I only see one row even though my table contains two sets of <tr> tags?

Answer

The rows within your table will not be visible until you have created cells or headings within the <tr> tags. In the next exercise, you will populate the first row with table headings and this row will be visible.

27 Likes

I did not do in yet.√

Because you set up only one line using

tag.
If you wanna insert two lines, you must have to set up two tags and add data using tag.





2 Likes

I love how Wiki-bot asks questions to clarify what’s already on our minds. Thanks wiki-bot! :smiley:

8 Likes

Can I number my data or rows?

Like instead of just putting “tr” can I put “tr1”,“tr2” and so on.
Likewise for data, td to td1,td2, and so on.

Would it cause any problems to do code?

2 Likes

Have the same question. Hope, someone can help

2 Likes

@javamaster97346 and @cloud0687405106

No you cannot modify a HTML tag for a html element such as td or tr, you can however add an id tag to the specific element like so:

<tr id="first_row">
      <td>...</td>
      <td>...</td>
</tr>

However keep in mind you can only use a specific id tag once. Having two elements with the same id tag is not possible.

6 Likes

If you really needed to label them you could always leave a comment labeling it for yourself later. A comment will not effect the code.

4 Likes

I think wiki-bot is trying to say: Because only one of the rows has table data to show. The other row is still empty so it does not show.

1 Like

I agree… we set up 2 td but only entered actual data into one row. The white space for the 1st td was ignored.

Bots ask the same question they have been assigned to. I think these questions are strategically placed in order to engage the students. That’s the reason I love codecademy.

1 Like

So if I have 50 tables with rows and cells in my html code , all of them will show up on the webpage? Are tables automatically displayed??

I am struggling with table data can someone help me please

2 Likes

In this exercise, why do we do the second row first?

Make sure you put the data in the second row first. The program says either are correct however that may be an issue for the following page. The first set of opening and closing table row tags tags should be empty. Just one suggestion, I am not sure if that solves your problem.

That’s a good question @data8636296807. I’m afraid I don’t know the answer but logic tells me that the browser has a limit where it stops displaying rows (as it wouldn’t size on the screen).

Now my question is with regard to something that happened in the lecture about Introduction to tables, specifically the table data subsection. I don’t know if it’s a bug (I don’t think so), but rather how the browser is prepared for interpreting bad HTML correctly.

So the code I did was the following:

<table>
  <tr>
  </tr>
    <td>Whatever they told me to type in</td>
    <td>Whatever they told me to type in 2</td>
    <td>Whatever they told me to type in 3</td>
  <tr>
  </tr>
</table>

And the system said that it was correct. I know the browser expects to make errors (something amazing and I do not understand) and HTML is a really flexible markup language (although this would be a really bad code). So can this be explained w/o super technical details? Or I must continue studying until I figure out how programs really work?

Clearly the solution is

<table>
  <tr>
  </tr>
  <tr>
    <td>Whatever they told me to type in</td>
    <td>Whatever they told me to type in 2</td>
    <td>Whatever they told me to type in 3</td>
  </tr>
</table>

But both compiled correctly. Another suggestion I would make to Codecademy developers and management team is to allow use the indent into the comments. I cannot and I had to type this code on my notepad and then cut it here (using spaces there bc the indent on the notepad is way more lenghty than two spaces). Here if I use the tab it goes to the reply button. Also I would suggest that the default shortcut for the Blockquote and the Preformatted text did erase only the text inside when starting typing and not all the functionality itself. I hope I’m explaining correctly.