HTML <TR> valign Attribute

The valign attribute is used to set the vertical l alignment of cell data in a table row. The valign attribute can support four values one at a time which include top, center, bottom or baseline.

valign attribute with top value display the data on top part of the table row.

valign attribute with center value display the data on center of the table row.

valign attribute with bottom or baseline value display the data on bottom part of the table row.

   1:  <html>
   2:  <head>
   3:  <title>
   4:  TR valign attribute
   5:  </title>
   6:  </head>
   7:  <body>
   8:  <table border="1" style="height:200px">
   9:  <tr valign="top">
  10:  <td>
  11:  Top
  12:  </td>
  13:  <td>
  14:  Alignment
  15:  </td>
  16:  </tr>
  17:  <tr valign="center">
  18:  <td>
  19:  Center
  20:  </td>
  21:  <td>
  22:  Alignment
  23:  </td>
  24:  </tr>
  25:  <tr valign="bottom">
  26:  <td>
  27:  Bottom
  28:  </td>
  29:  <td>
  30:  Alignment
  31:  </td>
  32:  </tr>
  33:  <tr valign="baseline">
  34:  <td>
  35:  Baseline
  36:  </td>
  37:  <td>
  38:  Alignment
  39:  </td>
  40:  </tr>
  41:  </table>
  42:  </body>
  43:  </html>
  
image 

Tags: , , , , ,

Author: Revo

Share This Post On

Submit a Comment

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

four × 4 =

 

Pin It on Pinterest

Shares
Share This