Colspan


#1

were do I put my colspan in on my page


#2

at the <th> tag? What is the problem?


#3

oh ok I got it thanks


#4

having the same issus
here it is
'''



<body>

    <table style="border-collapse:collapse;">
        <thead>
            <tr>


Famous Monsters by Birth Year







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


'''


#5

am having a issue with where to put my span, have done all i know but its not working.

<html>
    <head>
        <title>Table Time</title>
    </head>
    
    <body>
        
        <table style="border-collapse:collapse;">
            <thead>
                <tr>
  <th style="colour:red;"></th>
  <em>Famous Monsters</em> by<em> Birth Year</em></th>
                </tr>
                <tr style="border-bottom:1px solid black;">
                    <th style="padding:5px;">Famous Monster</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>

</html>

#6

You start with 3 th tags:

<th>Famous Monsters by Birth Year</th>
<th style="padding:5px;">Famous Monster</th>
<th style="padding:5px;border-left:1px solid black;">Birth Year</th>

first of, the em tags should be in famous monster AND birth yeard (second and third th tag) and not in famous monsters BY birth year.

Second problem, if you have a html element:

<img>

and you want to add an attribute to it (style, src or something else) you don't need to create addition tags, you can simple do:

<img src="#">

The way it should NOT be done:

<img><img src="#">

if you want to have multiply attributes, you can just separate them with a space:

<img src="#" alt="my_image">

same for style and colspan. Also, color is spelled the American fashion/way (without u), you use the British grammer


#7

its still the same.i stil dont get it


#8

Could you post an updated version of your code?


#9

''''



<body>

    <table style="border-collapse:collapse;">
        <thead>
            <tr>
<th style="colour:red;colspan=2"> <em>Famous Monsters</em> by<em> Birth Year</em></th>
            </tr>
            <tr style="border-bottom:1px solid black;">

                <th style="padding:5px;">Famous Monster</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>


'''


#10

your <em></em> tags are still at the wrong place.

style and colspan are both attributes, lets say i have a style attribute with 2 property's:

<p style="color: red; font-size: 16px;">i am red and 16px</p>

those you separate with a colon, but if you have two attributes:

<th style="" colspan="">

see? attribute values are between the quotation marks ("), attributes on a single html element are separated by spaces.


#11

hi just wanna ask you a question
i add red color to my colspan but just wanna be sure if it's the good way to do it.




<body>

    <table style="border-collapse:collapse;">
        <thead>
            <tr style="color: red">
                <th colspan="2">Famous Monsters by Birth Year</th>
            </tr>

#12

Yes, that is perfectly valid, and it seems to pass the exercise. You could also add the style and colspan to the th opening tag:

<th colspan="2" style="color: red">

but both ar valid


#13

thank you for your help.