Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Tables Table Basics Create a Table

Gabriel Adams
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gabriel Adams
UX Design Techdegree Graduate 20,081 Points

Can't get past this quick even though I feel like I'm entering the correct code. What am I missing?

Error: "Be sure to include exactly 2 <td> tags between each of the four <tr> tags."

I have done this yet I cannot proceed.

index.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>HTML Tables</title>
  </head>
  <body>
    <table>
      <tr>
        <td>Name<td>
        <tr>
          <td>Job</td>
          <tr>
            <td>Email<td>
            <tr>
              <td>Phone<td>
  </body>
</html>

3 Answers

The code has 7 <td> elements. The line <td>Job</td> contains only one <td> element.

While jb30 is correct, I'd like to point out that coding tables like this is going to cause you lots of issues with readability and sometimes with functionality. It is a good idea (and is required with some frameworks and languages) to close your tags. If you had closed your tags, it would have been much easier for you to see where your mistake was. Many developers would have written it like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>HTML Tables</title>
  </head>
  <body>
    <table>
      <tr>
        <td>Name</td>
        <td>Job</td>
      </tr>
      <tr>
        <td>Bob</td>
        <td>Artist</td>
      </tr>
      <tr>
        <td>Todd</td>
        <td>Developer</td>
      </tr>
      <tr>
        <td>Joe</td>
        <td>Manager</td>
      </tr>
    </table>
  </body>
</html>

While this is usually the preferred method of formatting, sometimes if you have small amounts of data in the cells, it can be easier to read if you make the code actually look like a table, like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>HTML Tables</title>
  </head>
  <body>
    <table>
      <tr> <td>Name</td>  <td>Job</td>       </tr>
      <tr> <td>Bob</td>   <td>Artist</td>    </tr>
      <tr> <td>Todd</td>  <td>Developer</td> </tr>
      <tr> <td>Joe</td>   <td>Manager</td>   </tr>
    </table>
  </body>
</html>