In the above webpage example you study the html code in the left part and to test yourself you write the same code in a notepad in your system and save it as myfirsttable.html in mydocuments or in some othe folder of your system and go to that folder and you will find the webpage icon with name myfirsttable You open it by clicking and your internet explorer or firforx browser will display that webpage which will be same as shown on the rightside of the above chart.
In the above table no speacial attributes of table tags are used this only a model for a simple table. The table is defined with two main <table> </table> tags and the rows in the table are defined with <tr> </tr> tags the cells in a row are defined with two <td> </td> tags and the column headings are defined with <th> </th> tags. Here only one attribute of table border="1" is used without this tag the table border will not be visible.
| A table with border="0" and cellspacing="3"(the cell spacing attribute decides the space between cells in the table) |
|
<table width="200"cellspacing="3"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="1" and cellspacing="3" |
|
<table width="200"cellspacing="3"border="1"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="1" and cellpadding="1"(cellpadding decides the space between the content in the cell and the wall of the cell) |
|
<table width="200" border="1'cellpadding="1"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="1" and cellspacing="2"cellpadding="2" |
|
<table width="200"border="1"cellpadding="1"cellspacing="1"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="3" and cellspacing="5"cellpadding="5" (the border size indicates the thickness of table border) |
|
<table width="200"border="3"cellpadding="5"cellspacing="5"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="0" and cellspacing="1" the align attribute with table tag decides the place of table and with <td> tag decides the place of content in the cell |
|
<table width="100%"cellspacing="1" align="right"><tr><td width="50%"align="center">first cell</td><td width="50%" align="right">second cell</td><tr><td align="left">third cell</td><td align="center">fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="3"bordercolor="red" (the border color indicates the color of the table border) |
|
<table width="200"border="3"bordercolor="red"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="3"bgcolor="yellow" (the bgcolor indicates the background color of the table) |
|
<table width="200"border="3"bgcolor="yellow"><tr><td width="100">first cell</td><td width="100">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| first cell | second cell | | third cell | fourth cell |
|
| A table with border="3"bgcolor="yellow" with <td>tag (the bgcolor indicates the background color a cell) |
|
<table width="200"border="3"><tr><td width="100">first cell</td><td width="100"bgcolor="yellow">second cell</td><tr><td>third cell</td><td>fourth cell</td></tr></table>
|
| firstcell
| secondcell | | third cell | fourth cell |
|