Setting up a Web Site - HTML



Description

Table Tags

<TABLE> </TABLE>
Defines text between the tags as a table

<TR> </TR>
Start and end of a row in the table

<TD> </TD>
Table data, for an item in each column in a row

<TH> </TH>
Table header (used instead of TD)

A Simple Table

This example uses basic table commands:

Fall 1995 Fall 1994 Fall 1993
Headcount 5554 5544 5539
Total Credits 79,667 79,814 79,612
Full-time 5266 5266 5245
Part-time 288 278 294

The HTML for this sample looks like this:

<TABLE BORDER> <TR> <TD></TD> <TD>Fall 1995</TD> <TD>Fall 1994</TD> <TD>Fall 1993</TD> </TR> <TR> <TD>Headcount</TD> <TD>5554</TD> <TD>5544</TD> <TD>5539</TD> </TR> <TR> <TD>Total Credits</TD> <TD>79,667</TD> <TD>79,814</TD> <TD>79,612</TD> </TR> <TR> <TD>Full-time</TD> <TD>5266</TD> <TD>5266</TD> <TD>5245</TD> </TR> <TR> <TD>Part-time</TD> <TD>288</TD> <TD>278</TD> <TD>294</TD> </TR> </TABLE>

Slightly More Advanced

This uses row and column headers plus alignment:

95 94 93
Headcount 5554 5544 5539
Total Credits 79,667 79,814 79,612
Full-time 5266 5266 5245
Part-time 288 278 294

Part of the HTML for this table:

<TR ALIGN="CENTER"> <TH></TH> <TH>95</TH> <TH>94</TH> <TH>93</TH> </TR> <TR ALIGN="RIGHT"> <TH>Headcount</TH> <TD>5554</TD> <TD>5544</TD> <TD>5539</TD> </TR>

Changing the Appearance

Changes the size of borders:

95 94 93
Headcount 5554 5544 5539
Total Credits 79,667 79,814 79,612

This is done in the table tag:

<TABLE BORDER=10 CELLSPACING=10>

You can also add space within table and set a background color for individual cells:

95 94 93
Headcount 5554 5544 5539
Total Credits 79,667 79,814 79,612

Space is done in the table tag with CELLPADDING parameter:

<TABLE BORDER CELLPADDING=10>

Color is added within a cell tag using BGCOLOR parameter:

<TD BGCOLOR="#00FFFF"> 79,814</TD>

An Advanced Table

This uses rowspan and colspan, features which allow a cell to expand.

Preliminary
Data
Undergraduate Enrollment Graduate Enrollment
Fall 1995 Fall 1994 Fall 1993 Fall 1995 Fall 1994 Fall 1993
Headcount 5554 5544 5539 939 932 887
Total Credits 79,667 79,814 79,612 4,928 4,842 4,703
Full-time 5266 5266 5245 228 219 208
Part-time 288 278 294 711 713 679

The HTML for this sample (in part) looks like this:

<TR> <TH ROWSPAN=2> Preliminary<BR>Data </TH> <TH COLSPAN=3> Undergraduate Enrollment </TH> <TH COLSPAN=3> Graduate Enrollment </TH> </TR> <TR> <TH> Fall 1995 </TH> <TH> Fall 1994 </TH> <TH> Fall 1993 </TH> <TH> Fall 1995 </TH> <TH> Fall 1994 </TH> <TH> Fall 1993 </TH> </TR> <TR ALIGN = RIGHT> <TH>Headcount</TH> <TD>5554</TD> <TD>5544</TD> <TD>5539</TD> <TD>939</TD> <TD>932</TD> <TD>887</TD> </TR>

Go to Top of Page

Back to Contents Page On to Next Section


Web Development Workshop
1999 MSACROA Conference
Sunday, November 28, 1999