Using Tables - Part 2

Previous page...

Table Headers

You can also use the <TH> tag instead of the <TD> tag to add a heading to your table columns, in the following way: <TH>Creatures</TH>



<TABLE BORDER="1"> 
	<TR> 
		<TH>Creature</TH> 
		<TH>Size</TH> 
	</TR> 

	<TR> 
		<TD>Tyrannosaurus Rex</TD> 
		<TD>Biggest</TD> 
	</TR> 
	
	<TR> 
		<TD>Elephant</TD> 
		<TD>Big</TD> 
	</TR> 
	
	<TR> 
		<TD>Ant</TD> 
		<TD>Small</TD> 
	</TR> 
</TABLE> 

Creature Size
Tyrannosaurus Rex Biggest
Elephant Big
Ant Small

NOTE: It's very easy to loose track of the different parts of your HTML when making a table. Here's a couple of tricks to help keep things clear.

  1. Try to put the HTML for each table cell on a separate line and to indent the text so that you can easily see the different parts of your table.
  2. Keep your border value at 1 so that you can see the layout you are making, if you don't want to see the borders in your final page, change it to 0 when the layout is finished.
Tables Part 1 Part 2 Part 3 Part 4 Part 5

© 2003 Ashley Preston 

Computeach International Ltd