Attribut "colspan" et "style" together


#1


Exercice 9; HTML 3


I don't know how put "Monstres célèbres par année de naissance" in red color ( with already "colspan=2" ) I know that is " style="color:red" but where place that ?

Thank you for your help and sorry for my english

<html>
    <head>
        <title>Les tableaux</title>
    </head>
    
    <body>
        
        <table style="border-collapse:collapse;">
            <thead>
                <tr>
                    <th colspan="2">Les monstres célèbres par année de naissance</th>
                </tr>
                <tr style="border-bottom:1px solid black;">
                    <th style="padding:5px;"><em>Les monstres célèbres</em></th>
                    <th style="padding:5px;border-left:1px solid black;"><em>Année de naissance</em></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;">Frankenstein</td>
                    <td style="padding:5px;border-left:1px solid black;">1944</td>
                </tr>
            </tbody>
        </table>
        
    </body>

</html>


#2

you can just separate attributes with a space, let me show you:

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

colspan and style are both attribute, you can just add them to one opening tag by separating them with a space


#3

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