New Table Extensions

Table Tags

Examples

Back to the index

Table Tags

It is possible now to create tables in an HTML document, using the following tags:

<TABLE> </TABLE>
This tag surrounds the table. If you want your table to have a border, use the <TABLE BORDER=someNumber> tag. Border size is 1 by default.

<TH>
Table headers are bold and aligned center by default. They can go anywhere in the table. Use <TH ALIGN=LEFT> or <TH ALIGN=RIGHT> for left or right alignment.

The <TH> tag has two optional extensions: ROWSPAN=someNumber and COLSPAN=someNumber. There are used when you want to have an extra long or extra wide table header.

<TR>
This table row tag should be used at the beginning of each desired row of the table. The closing </TR> tag is optional.

<TD>
This is the tag for the elements of the table. Table elements are in plain text, and aligned left by default. Use <TH ALIGN=LEFT> or <TH ALIGN=RIGHT> for left or right alignment.


Examples

A Simple Table:
ColorsFoodPeople
I likePurpleToffeeFriends
Dont likeYellowSquashPsychos

Source for Simple Table:

<TABLE><CAPTION>Example of a Simple Table with no Border:</CAPTION>
<TR><TH><TH>Colors<TH>Food<TH>People
<TR><TH ALIGN=LEFT>I like<TD>Purple<TD>Toffee<TD>Friends
<TR><TH ALIGN=LEFT>Dont like<TD>Yellow<TD>Squash<TD>Psychos

</TABLE><P>

Complicated Table 1:
averageother
category
heightweight
males1.90.003yyy
females1.70.002xxx

Source for Complicated Table 1:

<TABLE BORDER><CAPTION>Example Table 1:</CAPTION>
<TR> <TH ROWSPAN=2> <!--this one is just empty-->     <TH COLSPAN=2>average <TH ROWSPAN=2>other 
     <BR>category

<TR> <TH>height<TH>weight</TR>
<TR> <TH ALIGN=LEFT>males <TD>1.9 <TD>0.003 
     <TD ALIGN=CENTER>yyy

<TR> <TH ALIGN=LEFT>females <TD>1.7 <TD>0.002 
     <TD ALIGN=CENTER >xxx

</TABLE> <P>
Complicated Table 2:
averageother
category
heightweight
males1.90.003yyy
females1.70.002xxx

Source for Complicated Table 2:

<TABLE BORDER=5><CAPTION>Example Table 2:</CAPTION>
<TR> <TH ROWSPAN=2> <!--this one is just empty-->     <TH COLSPAN=2>average <TH ROWSPAN=2>other 
     <BR>category

<TR> <TH>height<TH>weight</TR>
<TR> <TH ALIGN=LEFT>males <TD>1.9 <TD>0.003 <TD>yyy

<TR> <TH ALIGN=LEFT>females <TD>1.7 <TD>0.002 <TD>xxx

</TABLE> <P>

Using Tables to Frame Images

Source for Using Tables to Frame Images:

<TABLE BORDER=10>
<CAPTION>Using Tables to Frame Images</CAPTION><TR> <TD ALIGN=CENTER> <IMG SRC="flower.gif"> <P>
</TABLE>
Back to the index

Last updated 27 june 95 by katie