Lesson 9 : Table




Basic Table Tags

A table can be created using the following tags

<TABLE></TABLE> Tags that create a table

<TR><TR> Tags that set each row in a table

<TD></TD> Tags that define each cell in a row

Example:
 
<HTML>
<HEAD><TITLE>TABLE</TITLE></HEAD>
<H1 ALIGN=center>TABLE</H1>
<HR>
<BODY bgcolor=blue text=white>
<TABLE>
<TR>
<TD>Apple</TD>
<TD>Fruit</TD>
<TR>
<TD>Cabbage</TD>
<TD>Vegetable</TD>
</TR>
<TR>
<TD>Whale</TD>
<TD>Mammal
</TD>
</TR>
<TR>
<TD>Horse</TD>
<TD>Mammal</TD>
</TR>
<TR>
<TD>Shark</TD>
<TD>Fish</TD>
</TR>
<TR>
<TD>Mars</TD>
<TD>Planet</TD>
</TR>
<TR>
<TD>Sun</TD>
<TD>Star</TD>
</TR>
</TABLE>
</BODY>
</HTML>

Copy the codes above and paste them into your notepad. Save the file as table1.html.

Click here to view the sample output.

[Back to Main Page]