TABLES IN NETSCAPE

The implementation of tables in graphic Web browsers like Netscape and Internet Explorer have helped alleviate the problems HTML programmers have had in page layout. Now you can place nearly any HTML element in the cell of a table and control the spatial relationships between these elements. With a little knowledge and perseverance you can create a very pleasing and professional looking page.


Your Basic Table Stucture looks like this:

Basic Table Structure
CELL1 CELL2 CELL3
CELL4 CELL5 CELL5

The HTML looks like this:

<Table border>
<caption> Basic Table Structure </caption>
<TR> <TH> CELL1 </TH> <TH>CELL2 </TH><TH>CELL3</TH></TR>
<TR> <TD> CELL4 </TD> <TD>CELL5</TD> <TD>CELL5</TD> </TRr>
</Table>

You'll notice that there are two basic cell elements, the <TH> tag and the <TD> tag. The <TH> tag , table header, will be bold text and centered. The <TD> tag, table definition or table data, usually contains your content, and this is not bold text and default aligned left. Of course, you can apply any type of text formatting tag within the the cell elements. The <CAPTION> tag allows you to place a caption above or below your table.
The <TABLE> tag itself can contain many attributes: BORDER=, HEIGHT=, WIDTH=, BGCOLOR=, CELLPADDING=, CELLSPACING=, ALIGN=and VALIGN=.

By changing the <TABLE> tag above to this:

<TABLE BORDER=6 BGCOLOR="WHITE" HEIGHT=100 WIDTH=300 CELLPADDING=5 CELLSPACING=10 ALIGN="CENTER">
We produce the table below. All the other tags are the same, yet we have quite a different looking table.
.
Aint No Default Table Structure
CELL1 CELL2 CELL3
CELL4 CELL5 CELL5

NOTE: Internet Explorer has a BORDERCOLOR= attribute that allows the specification of different border colors.

Many of these attributes can be used to modify or control the appearance of indivdual cells or an entire row. In the table below varied alignments and colors are affected through using some of these attributes in the <TR>, <TH> or <TD> tags:

DOMINANT HEADEROTHER HEADER
BLUERED
YELLOWBLACK

Now it starts to get more interesting. If you'll notice there is no border. That's because I didn't put a border attribute in the <TABLE> tag. By using the WIDTH=75% attribute in the <TH> tag I made the cell on the left longer. The height and width attributes can be specified in a % of the browser window or as the number of pixels. Giving BGCOLOR= a different value in each of the cell tags gives us the different background colors. (logical?)


3 Column Header 2 Column Header
normal cell normal cell normal cell normal cell normal cell
Row span of 3 Colspan of 4
normal cell Colspan is 3
Rowspan is 2
normal cell
Table Using Colspan and Rowspan Attributes
The <TH>; and<TD> tags also have the COLSPAN= and ROWSPAN= attributes. These attributes allow you to create cells that span more than one column or row. Let's see how that is implemented in Netscape. The table that is at the right was created using these attributes. This table is aligned right to allow wrapping of the text around it, just like the image tag. You can see from this small example that a table can take many shapes. This is its strength. By breaking up the page using a table you can place text and images just about anywhere you want to. Sometimes, this can be very easily done. By using cellpadding , colors, alignment and other attributes you find you have the tools to do some pretty creative things. You'll have to view the document source to see the HTML.

Nested Tables and Other Tricks


Tables have many combinations and permutations (possibilities). With tables you can have multicolumn text pages with graphics interspersed. The example below has a graphic in its own table which allows me to put a little frame around the portrait of Kant. This is simply a table with one row and two cells. Yet it creates a table (page?) that is familiar and pleasing to the eye.

Kant gif here
Now this is a picture of the philosopher, Kant. It has been so long since I have read or studied anything of Kant's I couldn't tell one dialectic materialism from another. The only point to this ongoing text babble is to fill the area around Mr. Kant with text. To this end I will continue to babble. To many of you this nonsense is probably more entertaining than the talk I have been giving in the guise of a tutorial on tables. If this is true then this text has served its purpose as a mindless diversion.
In order to finish this example of page layout using the < TABLE> tag, I will continue entering text as though I had some gloriously illuminating theory I wanted to communicate to this esteemed group. Of course, this is far from the truth of the matter; I am only continuing to try to fill Cyberspace with more useless HTML tutorials. I hope this example of a two column page with a "nested table" looks as good as I imagined it should. I loaded the table into the browser and realized I still hadn't babbled quite long enough to fill this cell of the table. With this valueable knowledge in hand, I returned to my handy HTML editor to add a little more text. I have used text here to fill out the cell.

A One Row, Two Celled Table
with a Nested Table

I could k