Creating a table using HTML (using Rowspan and Colspan)



                                Expected Output Table


<!DOCTYPE html> <html> <head> <title>Table </title> </head> <body> <div> <table width="1000px" cellpadding="10" cellspacing="0" border="2"> <tr > <th colspan="5">SURKHET MODEL COLLEGE</th> </tr> <tr> <th colspan="5">Faculty of Management</th> </tr> <tr> <td rowspan="4">Detail of student</td> <td>S.N</td> <td>Name </td> <td>Roll no.</td> </tr> <tr> <td>1.</td> <td>Ram</td> <td>4</td> </tr>


<tr> <td>2.</td> <td>Sam</td> <td>6</td> </tr> <tr> <td>3.</td> <td>Mam</td> <td>5</td> </tr>

            <tr> <td>4.</td> <td>Bam</td> <td>8</td> </tr> </table> </div> </body> </html>

Here, colspan combine /merge the columns as mentioned .

Comments

Popular posts from this blog

Basic Calculator with HTML and JS