Create the table using colspan and rowspan.

 


Code


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Create a Table using colspan and rowspan</title>
</head>

<body>
    <table border="1">
        <th colspan="4">Work Contact Points</th>
        <tr>
            <th>Name</th>
            <th>Email</th>
            <th>Phone</th>
            <th>Floor/Block</th>
        </tr>
        <tr>
            <td style="background-color:yellow;">Fred</td>
            <td style="background-color:DodgerBlue;">fred@megacorp.com</td>
            <td style="background-color:yellow;">123456</td>
            <td rowspan="2" style="background-color:Green;">
                <center>1/A</center>
            </td>
        </tr>
        <tr>
            <td style="background-color:DodgerBlue;">Jon</td>
            <td style="background-color:yellow;">jon@megacorp.com</td>
            <td style="background-color:DodgerBlue;">234567</td>
        </tr>
        <tr>
            <td style="background-color:yellow;">Bill</td>
            <td style="background-color:DodgerBlue;">bill@megacorp.com</td>
            <td style="background-color:yellow;">345678</td>
            <td rowspan="3" style="background-color:red;">
                <center>3/C</center>
            </td>
        </tr>
        <tr>
            <td style="background-color:DodgerBlue;">Jane</td>
            <td style="background-color:yellow;">jane@megacorp.com</td>
            <td style="background-color:DodgerBlue;">777444</td>
        </tr>
        <tr>
            <td style="background-color:yellow;">Alison</td>
            <td style="background-color:DodgerBlue;">alison@megacorp.com</td>
            <td style="background-color:yellow;">888652</td>
        </tr>
    </table>
</body>

</html>

Output




Comments

Popular posts from this blog

Write A Program To Print Hello World Using Lex

Create a Student registration form using following tags form,input,textarea,button,select,optio. The registration form must consist of following information: first name,Middle name,last name, gender(use radio button),address,phone no,email id,hobbies(use checkbox),city,state,country,collage name (use dropdown menu).