What have i done wrong? HTML BASICS 3 style that head

Table Time
<body>
    
    <table style="border-collapse:collapse;">
        <thead>
            <tr>
                <th colspan="2">Famous Monsters and Birth Year</th>
            </tr>
            <tr style="border-bottom:1px solid black;">
               <em <th style="padding:5px;">Famous Monster</th> </em>
                <th style="padding:5px;border-left:1px solid black;">Birth Year</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td style="padding:5px;">King Kong</td>
                <td style="padding:5px;border-left:1px solid black;">1933</td>     
            </tr>
            
            <tr>
                <td style="padding:5px;">Dracula</td>
                <td style="padding:5px;border-left:1px solid black;">1897</td>
            </tr>
            
            <tr>
                <td style="padding:5px;">Bride of Frankenstein</td>
                <td style="padding:5px;border-left:1px solid black;">1944</td>
            </tr>
        </tbody>
    </table>
    
</body>

This does not look right. The outer tags should be <th>...</th> with the <em> ... </em> wrapping the text inside.

OK… Now i get what they are saying. Thank you for the reply!!

1 Like

Also, I tried doing the red text separately, Is this a bug or is it just me?

Can you show us how you tried the red text?

OK, let me pull it up

It will take a second, im out of town with slow internet

Ok, here it is. I have it finished now but now its out of position, or is this normal?

Table Time
<body>
    
    <table style="border-collapse:collapse;">
        <thead>
            <tr>
                <th colspan="2"><th style=" color:red">Famous Monsters and Birth Year</th>
            </tr>
            <tr style="border-bottom:1px solid black;">
               <th style="padding:5px;"><em>Famous Monster</em></th> 
                <th style="padding:5px;border-left:1px solid black;">Birth Year</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td style="padding:5px;">King Kong</td>
                <td style="padding:5px;border-left:1px solid black;">1933</td>     
            </tr>
            
            <tr>
                <td style="padding:5px;">Dracula</td>
                <td style="padding:5px;border-left:1px solid black;">1897</td>
            </tr>
            
            <tr>
                <td style="padding:5px;">Bride of Frankenstein</td>
                <td style="padding:5px;border-left:1px solid black;">1944</td>
            </tr>
        </tbody>
    </table>
    
</body>

colspan and style are both attributes which you can add too the <th> opening tag, so something like this:

<th colspan="" style="">

No need to have two <th> opening tags

Is that why the title is in the middle of the page?

Yea, colspan + th is causing for the center of the title.

Ok, thanks for the reply!