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 HTML Tables

I do not see what is the problem with my code!

I do not see what is the problem with my code!

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Tables Challenge</title>
  </head>
  <body>
    <h1>HTML Tables Challenge</h1>

    <!-- Write your code below -->

    <table border = "5" cellpadding="5" cellspacing="10">

        <thead>
            <tr>
                <td align="center">Name</td>
                <td align="left">Adress</td>
            </tr>
        </thead>
        <tbody> 
        <tr>
            <td>Jill</td>
            <td>Route 55</td>
        </tr>
        <tbody>
    </table>
  </body>
</html>

4 Answers

Steven Parker
Steven Parker
215,954 Points

:white_check_mark: Your spacing is fine. Spaces between attributes and values is ignored (but it is good practice to leave them off).

:point_right: The challenge asks you to "Put two header cells...", the keyword here is header. Besides being located inside the header area, a header cell would be tagged TH instead of TD, like this:

    <table border = "5" cellpadding="5" cellspacing="10">
        <thead>
            <tr>
                <th align="center">Name</th>  <!-- these are "header cells" -->
                <th align="left">Adress</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Jill</td>
                <td>Route 55</td>
            </tr>
        <tbody>
    </table>
Jeff Lemay
Jeff Lemay
14,266 Points

Right off the bat I can see that your border attribute on the table element is not set up properly (cannot have spaces on the sides of the equal sign).

border = "5" should be border="5"

Hi Jeff,

thanks for your reply.

My question was incomplete. The chaledge ask me to: "Put two header cells with any text inside of the row you just created". Can not see the bug!

it is specifically looking for th tags. you used td tags

huckleberry
huckleberry
14,636 Points

"Hi Jeff,

thanks for your reply.

My question was incomplete. The challenge ask me to: "Put two header cells with any text inside of the row you just created". Can not see the bug!"

The problem is that it asked you for table header cells and you used normal table row cells. Don't forget that table header cells have their own tags. You have thead which designates that "this here contains stuff that is the header" but inside of the thead, you still have to use table header tags, not table row tags, which is what you did.

Now you got it figured out? ;)

Cheers,

Huck - :sunglasses:

edit: why do I bother? lol... smh