HTML <TD> Height Attribute

When you create table in HTML you have observed that table cell takes place to adjust the date. The height attribute take the value in percentage or pixels to adjust the height of the cell. The height cell cannot be less than the height of the date within the cell on the other hand height could be increased by increasing the value, higher the number in percentage or pixels more will be the height of the table cell. it is important to note that change in height of a cell will also change the height of adjacent cell.

Let’s look at the HTML code in which the height attribute is used to change the formatting of table.

   1:  <html>
   2:  <head>
   3:  <title>
   4:  COLS attribute
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table border="1" width="100%">
   9:  <tr>
  10:  <td height="100">
  11:  Month
  12:  </td>
  13:  <td>
  14:  Year
  15:  </td>
  16:  </tr>
  17:  <tr>
  18:  <td>
  19:  March
  20:  </td>
  21:  <td>
  22:  2011
  23:  </td>
  24:  </tr>
  25:  </table>
  26:  </body>
  27:  </html>

Save the with filename.htm and open it in browser to see the below result.

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