Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGabriel Adams
UX Design Techdegree Graduate 20,081 PointsCan'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.
<!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
jb30
44,807 PointsThe code has 7 <td>
elements. The line <td>Job</td>
contains only one <td>
element.
Jason Larson
8,361 PointsWhile 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>
Gabriel Adams
UX Design Techdegree Graduate 20,081 PointsThank you both! Very helpful. Makes sense now.