HTML Table Height Attribute

The table height attribute is used to set the height of the table. The height attribute take value in percentage or pixels, it is recommended to use the value in percentage because pixels setting varies system to system.

The HTML code of line to change the height of table in percentage value look like this: <table height=”50%”>

The HTML code of line to change the height of table in pixels value look like this: <table height=”50”>  or <table height=”50px”>

Let’s see the usage of height attribute in the this HTML code example.

   1:  <html>
   2:  <head>
   3:  <title>
   4:  COLS attribute
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table border="1" width="100%" height="50%">
   9:  <tr>
  10:  <td >
  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>

Output of the HTML code

image

Tags: , , , ,

Author: Revo

Share This Post On

Submit a Comment

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

4 − 1 =

 

Pin It on Pinterest

Shares
Share This