219 users online (0 members and 219 guests)  


  HTML Table Basic Example





All the information in the previous tutorials may be a little hard to follow without an example of how to put it all together, I am going to show you the source code for a simple HTML table, and walk you through it step by step.


Here is a basic table:


SAN ANTONIO SPURS Record
1999
2003
2005
World Champions
World Champions
To Be Determined

Here is the source code with a step by step guide.

Example source code for basic HTML table
<table bgcolor="#888888" border="2" width="90%" cellpadding="2" cellspacing="1"> Starts the table, the table will have a 2 px. wide border and will have a gray background, will be 90% of the width, and has cellpadding of 2 px and cellspacing of 1 px
<tr> Starts first row
<th> Starts first header cell of the first row
SAN ANTONIO SPURS First cell content
</th> End first header cell of the first row
<th> Starts second header cell of first row
Record Second header cell content
</th> Ends second header cell of the first row
</tr> Ends first row
<tr> Starts second row
<td align="center"> Starts first cell of second row, contents aligned to the center
1999<br>2003<br>2005 First cell, second row contents
</td> Ends first cell of second row
<td align="center"> Starts second cell of second row, contents aligned to the center
World Champions<br>World Champions<br>To Be Determined Second cell, second row contents
</td> Ends second cell of second row
</tr> Ends second row
</table> Ends table

Back to the HTML menu.