Create Table with RowSpan and Col Span

     

    Code:

    <html>
    <head>
    <title>Create Table With Colspan & Rowspan </title>
    </head>
    <body>
    <center>
    <table border=2 bordercolor=red bgcolor=lightyellow align=center cellpadding="5px" cellspacing="5px" height="500" width="500">
    <tr>
    <th>Fruit</th>
    <th>Quantity</th>
    <th>Price</th>
    <th>Location</th>
    </tr>
    <tr>
    <td>Apple</td>
    <td>700</td>
    <td>88</td>
    <td>South</td>
    </tr>
    <tr >
    <td>Banana</td>
    <td colspan=4 align=center>No Sales</td>
    </tr>
    <tr>
    <td>Orange</td>
    <td>805</td>
    <td>75</td>
    <td rowspan=2 align=center>East</td>
    </tr>
    <tr >
    <td>Papaya</td>
    <td>500</td>
    <td>85</td>
    </tr>
    </table>
    </center>
    </body>
    </html>

     

    Output:

    Fruit Quantity Price Location
    Apple 700 88 South
    Banana No Sales
    Orange 805 75 East
    Papaya 500 85

     

    Download The Coding Along With Web Page