Monday, August 29, 2011

Create table in HTML

How to  create table in HTML ?
<html>

<head>

  <title>Tables</title>

</head>

<body bgcolor="#ffffff">

  <table border="1">

    <caption>
      My Favorite Albums
    </caption>

    <tr>
      <th>Artist</th>
      <th>Title</th>
      <th>Comment</th>
    </tr>

    <tr valign="top">
      <td>Manu</td>
      <td>Naveen</td>
      <td>Siddharth</td>
    </tr>

    <tr valign="top">
      <td>Singh</td>
      <td>Nick</td>
      <td>Sidd</td>
    </tr>

    <tr valign="top">
      <td>Student</td>
      <td>Job</td>
      <td>professional</td>
    </tr>

      </table>

</body>
</html>

(NOTE-<tr> TR tag use for table row ,<th> TH tag use for table heading , <td> TD tag use for table data , <caption> CAPTION tag use for title of table,you can also change VALIGN as bottom & middle  )

OUTPUT-
Tables
My Favorite Albums
Artist Title Comment
Manu Naveen Siddharth
Singh Nick Sidd
Student Job professional

No comments:

Post a Comment