HTML: The Definitive Guide

Previous Chapter 2 Next
 

2.10 Beyond the HTML Standard

We've alluded several times in this chapter to the fact that few browsers strictly adhere to the HTML 2.0 standard and stop there. The demand for innovation has many browser developers working feverishly to provide new and exciting features for HTML. Tables and frames are the two most prominent extensions to the language.

Tables

For a language that emerged from academia--a place steeped in data--it's surprising to find that standard HTML doesn't have any provision for data tables. Fortunately, the popular browsers support a set of language extensions for data tables that not only align your numbers, but can specially format your text, too.

Five tags enable tables, including the <table> tag itself and a <caption> tag for including a description of the table. Special tag attributes let you change the look and dimensions of the table. You create a table row-by-row, putting between the table row (<tr>) tag and its end tag (</tr>) either table header (<th>) or table data (<td>) tags and their respective contents for each cell in the table. Headers and data may contain nearly any regular HTML content, including text, images, forms, and even another table. As a result, you can also use HTML tables for advanced text formatting, such as for multicolumn text and sidebar headers (Figure 2-5). For more information, see Chapter 9, Tables.

Frames

Anyone who has had more than one application window open on their graphical desktop at a time can immediately appreciate the special, nonstandard feature of HTML uniquely offered in the latest version 2.0 of Netscape Navigator: frames. For more information on frames, see Chapter 10.

Figure 2-6 is an example of a frame display. It shows how the Netscape document window may be divided into many individual windows separated by rule lines and scroll bars. What is not immediately apparent in the example, though, is that each frame may display an independent document, and not necessarily HTML ones, at that. A frame may contain any valid content that the browser is capable of displaying, including multimedia. If the frame's contents include a hypertext link the user selects, the new document's contents, even another frame document, may replace that same frame, another frame's content, or the entire browser window.

Frames are defined in a special HTML document in which you replace the <body> tag with one or more <frameset> tags that tell Netscape how to divide its main window into discrete frames. Special <frame> tags go inside the <frameset> tag and point to the documents that go inside the frames.

The individual documents referenced and displayed in the frame document window act independently to a degree; the frame document controls the entire window. You can, however, direct one frame's document to load new content into another frame. Selecting an item from a table of contents, for example, might cause Netscape to load and display the referenced document into an adjacent frame for viewing. That way, the table of contents always is available to the user as they browse the collection.


Previous Home Next
Lists, Searchable Documents, and Forms Book Index Forging Ahead