HTML <TD> Colspan and Rowspan attribute

The colspan is attribute of TD which tell the browsers to span or merge the number of columns on the other hand Rowspan attribute specifies the number of rows to span or merge.

HTML code of the table with Colspan and Rowspan attribute.

   1:  <html>
   2:  <head>
   3:  <title>
   4:  rowspan and colspna
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table border="1" width="50%">
   9:  <tr>
  10:  <td colspan = "2">
  11:  Years 2011
  12:  </td>
  13:  </tr>
  14:  <tr>
  15:  <td rowspan="2">
  16:  Months
  17:  </td>
  18:  <td>
  19:  Jan
  20:  </td>
  21:  </tr>
  22:  <tr>
  23:  <td>
  24:  Feb
  25:  </td>
  26:  </tr>
  27:  </table>
  28:   
  29:  </body>
  30:  </html>

Save the file in .htm format and open it in browser to see the result as shown below.

image

Tags: , , , , , , , , ,

Author: Revo

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *

five × 5 =

 

Pin It on Pinterest

Shares
Share This