


BORDER:
CELLSPACING:
CELLPADDING:
The Caption Tag <CAPTION>...</CAPTION>
TABLE ROW <TR>...</TR>
Each <TR> tag indicates a separate row in your table, where a row defines
the horizontal divisions of the table structure.
TABLE DATA <TD>...</TR>
The <TD> tag defines what is known as a "data cell," which is simply
a single block of your table structure which contains a piece of the information you're presenting. Any text or HTML
document can be used as table data, but the browser will break large amounts of data so that
it fits the cell size. Each bit of data you convey must be
contained within the Table Data tags, which in turn must be contained within Table Row tags. You can have as many
rows of data as you wish, as long as you distinguish each separate row with the <TR>...</TR> tags.
You can also manipulate the table row and table data tags to create columns by using the ALIGN and VALIGN
attributes of the table data tag. The table data cells will fill in the table rows horizontally by default, but by using
the ALIGN attribute, you can specify "right" or "left" alignment like this:
<TABLE>This would build a very simple table with one row, divided into two columns, each containing one data cell of information. You could repeat this process on subsequent rows and even add more table data tags to make a more complex table. If you have more than two table data tags in a row, you would not need the ALIGN attribute, because the data cells fill in the table rows by default.
<TR>
<TD ALIGN=LEFT>data cell information</TD>
<TD ALIGN=RIGHT>data cell information</TD>
</TR>
</TABLE>
TABLE HEADER <TH> and the COLSPAN Attribute.
The table header describes a single block of the table which will appear in bold text as a heading for
a row or column. You can include as many table header tags as you need, as long
as each block is contained within the <TH> and </TH> tags.
If you have more than one vertical column in your table, you can use the COLSPAN
attribute to tell the Headers how many columns of the table
you want them to span, creating headings for multiple-column tables. This attribute should be written into the
table header tag like this:
<TH COLSPAN=2>Header Information</TH>
You can also use the ALIGN attribute within a table header, although in this instance, it will apply to the data you put in the heading, and not the actual placement of the header. After all, the header is going to span the number of columns you indicate, therefore any alignment of the header itself would be irrelevant. You can, however, center the text or align it to the right:
<TH COLSPAN=2 ALIGN=CENTER>Header Information</TH>
Note:COLSPAN and ALIGN function identically within the TD and TRtags.




|
upper frame | |
|
lower left frame |
lower right frame |
This table shows an example of a desired layout for the framed page. To accomplish this we will first divide the browser window into upper and lower frames, and then further divide the lower frame into lower-left and lower-right frames. The first of these two divisions is specified in layout document which we'll call a.html, as follows:
|
|
As you can see, this is a new kind of HTML. Several things are worth observing in this code:
<body> tags that usually
appear in HTML documents have been replaced by
<frameset> tags. This is the distinguishing feature
of layout documents.
<frame> is a
single entity and does not occur with a closing </frame> counterpart.

<Frameset> Tag<frameset> tags replace
<body> tags in layout documents. The opening
<frameset> tag must include either a row list or a
column list, taking the form
"rows=row_list" or
"cols=column_list" immediately after the keyword
frameset, as seen in a.html. Row or column lists
are comma separated lists of frame size specifications. In
a.html, we have chosen to allow browser software to determine row
frame heights by using the value * for each row. (The width
of the row frames will, in this case, be determined by the width of the
browser window.) Each member in a row or column list represents only a
declaration of a frame's existence. Frame definitions,
which specify the actual contents of previous declared frames, are
indicated within the <frame> tag.

<Frame> Tag<frameset> tags to divide the
browser window into two row frames, we must now instruct the browser what
to put in these frames. We accomplish this through the
<frame> tags, which occur between <frameset>
tags and define the contents of each frame declared in
the row or column list of the preceding frameset tag.
In our example, because the row list ("rows=*,*") specifies
the existence of two row frames, the code in a.html contains two
frame specifications. Before continuing, please take a
moment and look at them again.

<frame> tag by adding the
tag attribute "src=URL", as seen in
a.html. At view time, after the browser has laid out the
document's frames, it will then use these URLs to load documents for
display within the frames.

name=frame_name" in the <frame>
tag, as shown in the second frame definition in a.html. In this
example, the upper row has no name, while the lower row has the name
"bottom". Assigning names to frames makes it possible to
later target them for update when hyperlinks are selected.

The targeting frame name may be either an explicit name assigned to frames in layout documents, such as the frame name "<a href=document.htmltarget="frame name">Link</a>
bottom" appearing
in layout document a.html above, or what is called an implicit name, which is
determined by the frame's relationship to other frames. Implicit names
are reserved words beginning with an underscore (_) and contained within quotation marks.
Some of these are listed below:
_self- Directs the browser to update the frame containing the selected hyperlink. This is the default target if no target is specified at all.
_parent- Directs the browser to update the parent frame if the frame containing the hyperlink is a child frame, otherwise has the same effect as
_self._top- Directs the browser to update the entire window, regardless of the current frame layout. If you are providing a link to another framed document or a web site outside of your own, this specification is desired. This way, the user can leave the confines of your frames to view the other page on the full screen without the distortion of resizing it will undergo to fit inside your frames.
Take a close look at the hyperlinks in this code. The hyperlink attribute "X X
YZ ZY
target=bottom" means that the frame named "bottom"
will be the target for the new document when the user selects the
hyperlink.
Let's take this lesson a step further and assume that the frame named "bottom" targeted above
contains another layout document that divided its area into two "child frames" which will
in turn divide the bottom frame into another framed document. Follow the proceeding examples as
they synthesize both frame layout and targeting to put the frame syntax to use
in one comprehensive example.
First, you would need to have a layout document
indicating that frame "bottom" is another framed set of documents that appears when
that frame is targeted from a link on the original framed page. The source code for the layout document
dividing the bottom frame into two further frames would look like this:
|
|
|
| yz.html | zy.html |
We now move on to add the same functionality to the hyperlinks in frames
Y and Z.
Although much of the procedure is the same,
the context for hyperlinks in frames Y and Z is different because
the hyperlinks in these frames will update their own frames.
In other words, the hyperlinks in frames Y and Z will update themselves by
updating
their own parent frame.
This is a good opportunity
to demonstrate the use of an implicit frame name, "_parent,"
which refers to the parent frame (or window) of the frame containing the hyperlink.
YYZ ZY |
ZYZ ZY |
| y.html | z.html |
Notice the use of the implicit frame name "_parent".
We could just as well have used "bottom" as the target,
and the result would have been the same.
And now we're done! We've just created a multi-frame document that updates selected frames on demand without updating the entire window. If you already have a frames-compatible browser, give this example a try and watch how it works. If you've been engaged with all the x's, y's, and z's of Charlton Rose's examples, you'll be able to follow what he's done. If you're still confused (or become confused), come back for an explanation. To go back in frames, use the back button on your browser to return to the last page you were on before entering a framed site. If you are in a particular frame and wish to go back to the last document in the frame, hold down the right mouse button until a menu with "Back in Frame' or "Forward in Frame" options appear.
Rose's example specifies an initial frame layout page called a.html which divides the screen into three windows, X, Y, and Z, each with "frame source" contents documents named respectively, x.html, y.html, and z.html. In this case, x.html is a stand-alone document in the top portion of the screen, but the bottom part of the screen is a document called yz.html, which divides the bottom into the two documents you see, Y and Z. This is an example of the nested frame, which is a frame layout document that acts as the frame source contents document in the very first opening frame page. When the browser follows the instructions to find the document yz.html to display it in the lower window, it discovers that yz.html contains further instructions to divide the screen into Y and Z. In other words, the only information on document yz.html is a frameset command which goes out to find the documents Y and Z to display them in the two subdivided frames you see on the page. The links YZ and ZY are examples of targeting the nested frames Rose has incorporated into his layout documents. Note that when you click on YZ, Y appears in the lower left and Z appears in the lower right. When you click on ZY, the inverse is true. Don't be confused by the constant swapping of the screens. All that happens is that one nested frame--the initially targeting yz.html discussed above--contains the two documents Y and Z, which in turn contain targeted links to yet another nested frame document, zy.html, a document which merely reverses the frame positions of documents Y and Z. Rose's use of the implicit name _parent in his targeting commands is, in this case, merely another way of instructing the browser to display the contents of zy.html in the frame that contained the link to that document. When Rose says that he could have also used the frame name "bottom" instead of _parent, he means only that the new frame that will appear from the clicking the link to zy.html is laid out exactly the same way as yz.html and will also appear within the bottom frame on the page. It may have been more useful and more clear if he had changed the frame structure of zy.html so that you could see the difference, but hopefully my summary can clarify his programming a bit for you. Now, go back to the example and look again. This time, use the View Source feature to see if you can figure out all the steps he took in his example. After that, you may want to find some other frame examples and see how they function. Try these for example: Dan Backer, Portraiture in the U.S. Capitol
Sponsored by the American Studies Group at UVA ©1996
Maintained by Joshua Johns