Tables in HTML

When you want a lot of data to be put on a single page, tabular format is the best format.
I am in cell one I am in cell two
Did you notice the simple table above?
I am sure you did!

             

Anyway, let us see how to make a simple table using HTML.

     

The table tag is the <TABLE> tag.
I also gave the cellspacing and cellpadding attributes in it.
I will explain all these in a jiffy.
<TABLE> tag starts a table.
Then comes the <TD> tag.
This specifies a cell. The closing tag is </TD>.

     

The <TR> tag tells the browser to carry the following cell to the
next line.

     

It is like the <BR> tag.
Let us make a table then.

     

               

<TABLE border="1" cellpadding="20" cellspacing="10">
<TD>
I am cell one
</TD>
<TD>
I am cell two
</TD>
<TR>
<TD>
I am in cell three in the next line
</TD>
<TD>
I am in cell four in the next line
</TD>
</TR>
</TABLE>

               

This will give us this:
I am cell one I am cell two
I am cell three in the next line I am cell four in the next line

               

As you can see, the cellpadding is for size of each cell and cellspacing is for space between each cell.
Next--->