HTML Basics 3, section 5: Table Heads <!-- choosing tag placement-->


#1



The editor accepted my code and I continued to the next lesson from section 6 to section 7. I think there may be more than one way the tags: "thead" and "tbody" can be placed in the code as I am having issues figuring out where the tags should really be located in my code in section 7.


Here is my code from section 6:
<html>
    <head>
        <title>Table Time</title>
    </head>
    
    <body>
        <thead></thead>
        
        <tbody>
        <table border="1px">
            
                <tr>
                    <td>King Kong</td>
                    <td>1933</td>     
                </tr>
                
                <tr>
                    <td>Dracula</td>
                    <td>1897</td>
                </tr>
                
                <tr>
                    <td>Bride of Frankenstein</td>
                    <td>1935</td>
                </tr>
        </tbody>
        </table>
        
    </body>

</html>

Now here is my code in section 7:
<html>
    <head>
        <title>Table Time</title>
    </head>
    
    <body>
        
        <table border="1px">
            <thead>
                
            </thead>
            <tbody>
                <tr>
                    <td>King Kong</td>
                    <td>1933</td>     
                </tr>
                
                <tr>
                    <td>Dracula</td>
                    <td>1897</td>
                </tr>
                
                <tr>
                    <td>Bride of Frankenstein</td>
                    <td>1935</td>
                </tr>
            </tbody>
        </table>
        
    </body>

</html>


#2

It looks fine in both.

Perhaps I'm missing some part of your question, but if not, then you're good on your placement.


#3

Well I was thinking... it had to be overly complex for the developers of Codecademy to make this website. As with any website, I could understand the developers not being able to forsee this particular problem well enough for the computer to catch 100% of user error. Because of this, I wanted to make sure I was learning this well so I can always remember it properly.
Thanks for the quick response :slight_smile:


#4

Section 6 you have placed tbody before Table border="1px">. You need to put it after that. And section 7 they are placed correct places because when they added thead for you they placed the tbody in correct place.

Sorry my native language is not English but i hope you understand what i am trying to say.


#5

Thank you trickster. I will remember that now.


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.