Year 2 Semester 2

SECV 1223

Template for Web Programming

Lab 1 Question

Lab 1 Answer

Lab 2 Question

Lab 2 Answer

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

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>HTML Table</title>
    <!--
     Name: Gui Yu Xuan
     Matric No: A20EC0039
     Lab 1:HTML Table
    -->
</head>

<style>
    table, th, td{
        border: 1px solid black;
        border-collapse: collapse;
    }
</style>

<body>
    <table border>
        <tr>
            <th width="100"><b>Flight No</b></th>
            <th width="100"><b>Place</b></th>
            <th width="100"><b>Destination</b></th>
            <th width="200" colspan="2">Time</th>
        </tr>

        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td width="100" style="text-align:center">Arrival</td>
            <td width="100" style="text-align:center">Departure</td>
        </tr>
    </table>

    <br><br>

    <table border>
        <tr>
            <th width="100" rowspan="2">Time</th>
            <th width="100"><b>Johor Bahru</b></th>
            <th width="100"><b>Jakarta</b></th>
            <th width="100"><b>Dhaka</b></th>
            <th width="100"><b>Jeddah</b></th>
        </tr>

        <tr>
            <td width="100" style="text-align:center">3.30pm</td>
            <td width="100" style="text-align:center">2.30pm</td>
            <td width="100" style="text-align:center">1.30pm</td>
            <td width="100" style="text-align:center">10.30am</td>
        </tr>
    </table>

    <br><br>

    <table border>
        <tr>
            <thwidth="510"height="50"colspan="3"bgcolor="4863A0">BLUE</th>
        </tr>

        <tr>
            <td width="170" height="50" bgcolor="F62217" style="text-align:center">RED</td>
            <td width="170" height="50" bgcolor="12AD2B" style="text-align:center">GREEN</td>
            <td width="170" height="50" bgcolor="FFFF00" style="text-align:center">YELLOW</td>
        </tr>
    </table>

    <br><br>

    <table border>
        <tr>
            <th width="127">1</th>
            <th width="127">2</th>
            <th width="127">3</th>
            <th width="127">4</th>
        </tr>
       
        <tr>
            <th width="127">5</th>
            <td width="254" rowspan="2" colspan="2" style="text-align:center"><b>Image</b></td>
            <td width="127" style="text-align:center">6</td>
        </tr>

        <tr>
            <th width="127">7</th>
            <td width="127" style="text-align:center">8</td>
        </tr>

        <tr>
            <th width="127">9</th>
            <td width="127" style="text-align:center">10</td>
            <td width="127" style="text-align:center">11</td>
            <td width="127" style="text-align:center">12</td>
        </tr>
    </table>
</body>

</html>

Lab 3 Question

Lab 3 Answer

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

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Lab 2</title>
    <!--
        Name:       Gui Yu Xuan
        Matric No:  A20EC0039
        Lab 2:      HTML Forms
    -->
</head>

<body>
    <h1 style="font-family: Verdana; color: blue; text-align: center"><b>Medical Form</b></h1>

    <form action="process.php">
        <fieldset>
            <legend>Personal Information</legend>
            <table border>
                <tr>
                    <th width="100">First Name</th>
                    <td width="100"><input type="text" name="fname" </td>
                    <th width="100">Gender</th>
                    <td width="200">
                        <input id="female" type="radio" name="gender" value="f" />
                        <label for="female">Female</label>
                        <input id="male" type="radio" name="gender" value="m" />
                        <label for="male">Male</label>
                    </td>
                </tr>

                <tr>
                    <th width="100">Last Name</th>
                    <td width="200"><input type="text" name="lname" text-align:centre> </td>
                    <th width="100">Nationality</th>
                    <td width="200"><select name="nationality">
                            <option value="canadian">Canadian</option>
                            <option value="malaysian">Malaysian</option>
                            <option value="singaporean">Singaporean</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th width="100" rowspan="3">Address</th>
                    <td colspan="3"><textarea name="address" cols="25" rows="4">
                </textarea></td>
                </tr>
            </table>
        </fieldset>

        <fieldset>
            <legend>Medical History</legend>
            <input type="checkbox" name="diseases" value="smallpox" />Smallpox
            <input type="checkbox" name="diseases" value="mumps" />Mumps
            <input type="checkbox" name="diseases" value="dizziness" />Dizziness
            <input type="checkbox" name="diseases" value="sneezing" />Sneezing
        </fieldset>

        <fieldset>
            <legend>Current Medication</legend>
            <p>Are you currently taking any medication?
                <input id="yes" type="radio" name="answer" value="y" />
                <label for="yes">Yes</label>
                <input id="no" type="radio" name="answer" value="n" />
                <label for="no">No</label>
            </p>
            <p>If you are currently taking medication, please indicate it in the space below:
                <textarea name="ans" cols="100" rows="10">
            </textarea>
            </p>
        </fieldset>

        <input type="submit" value="Submit" />
        <input type="reset" value="Reset" />
    </form>
</body>

</html>

Lab 4 - 9