Create Simple Table in HTML

Table is the two dimensional matrix used to represent data in an organize way. Table is the combination of Rows and columns and their intersection point is called cell. The number of cells can be easily determined by multiplying number of table rows with columns.  For example, a table with 3 rows and 2 columns has 6 cells and each cell may contain any data such as number, characters, symbols and pictures.

In this tutorial we will learn how to create table in HTML using table tags. Our strategy is to keep things simple and easy, so we have plans to create multiple tutorials to cover the topics of HTML tables.

I would like to define the table tags before writing any HTML code for creating tables.

<Table>…</Table> everything within these tags represent table.
<TR> </TR>…  TR defines a single row in a table.
<TD></TD>… TD defines a single cell or column in a table.

We will be focusing on these take in this example. More tags will be discussed in our next tutorials. Let’s create a 3 rows X 2 columns table using the HTML table tags.


   1:  <Html> 
   2:  <head> 
   3:  <title> 
   4:  </title> 
   5:  </head> 
   6:  <body> 

7: It’s a simple table with 6 cells; you will be not able to see the table borders because we are not

currently using the border table attribute in this example.

   8:  <table> 
   9:  <tr> 
  10:  <td> 
  11:  Row 1, Column 1 
  12:  </td> 
  13:  <td> 
  14:  Row 1. Column 2 
  15:  </td> 
  16:  </tr> 
  17:  <tr> 
  18:  <td> 
  19:  Row 2, Column 1 
  20:  </td> 
  21:  <td> 
  22:  Row 2. Column 2 
  23:  </td> 
  24:  </tr> 
  25:  <tr> 
  26:  <td> 
  27:  Row 3, Column 1 
  28:  </td> 
  29:  <td> 
  30:  Row 3. Column 2 
  31:  </td> 
  32:  </tr> 
  33:  </table> 
  34:  </body> 
  35:  </html>

Now you need to save the file in .htm or .html format and open it in any browser to view the below output.



Tags: , , , , , ,

Author: Revo

Share This Post On

Submit a Comment

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

nineteen − nineteen =


Pin It on Pinterest

Share This