runway index

The Virtual World

Using Netscape ::

Chapter Index

Introduction
History
Getting Connected
Browsers
Copyright
Search Engines
HTML
Linking documents
Images
Newsgroups
Tables
Forms
Frames
Graphic crunching
Page and Site Design
Publishing
Javascript
Free Stuff
Styles
DHTML

 


Tables

Producing a decent layout for your web page was, until the use of tables, a hopeless affair. No doubt within the next few months the developments that are curently taking place will make the use of tables irrelevant for page design. The technology for good design is almost at an acceptable level. However, being able to create good design is one thing. The real question is: can the viewers see it?

The answer is, yes, if they have the most up-to-date version of either Netscape Navigator or Internet Explorer. If they are using version 3.x, or maybe are still using version 2.x because of its small footprint (i.e., those with ancient computers sporting small amounts of RAM can actually open the program) then the new developments are not going to display on their machines.

It has been estimated from hit counts on various sites that the take-up of the version 4 browsers has reached approximately 60% of users. That is a respectable figure, but still represents only just over half of all users. If only just over half of your viewers can see your latest tricks, you had better think carefully about using them.

For the moment it would be wise to use tables for placing text and graphics where you want them on your page. But you can gradually start to introduce more modern methods of placing items on the page. If you do this you need to think about using javascripts to find out which browser is being used, and if it is a version 3.x browser, deliver pages which have been designed using tables.

To place items right aligned on a page, or create a consistent space between separated elements we need to create tables and place our discrete items in cells within the tables.

Before we get under way let's look at a couple of problems we need to take into account. Tables have a habit of behaving strangely and we need to know how to deal with some of these problems.

First of all, there are two types of measurement you can apply to your table, each will cause it to display in a different way. You can set a percentage size (which is the default in most page creation applications). This is because you, as a designer, have no idea what size screen your viewer is using. More exactly, you know that your viewers are all using different sized screens from 9" up to 24". Your tables need to look good on all of them.

If you set your table to have a width of 100% it will fill the nine inch screen. It will also fill the 24 inch screen. This could make the display look ridiculous on both screens. If you have 15 inches of text and pictures scrunched into 9 inches of screen there will be some strange effects in your design. You will have a great many lines of text wrapped around that you hadn't bargained for when you designed your page. This will leave your pictures (which have loaded in the size indicated) pushing everything out of kilter. Your text will now stretch off the bottom of the screen where it has been squeezed by the pictures. The opposite will happen on a 24" screen. Your text will now be strung out across the page in a thin line.

All of this is very unsatisfactory. Initially it would be better to design your tables with fixed overall widths. This leaves your small screen viewers needing to scroll, but at least they see what you designed. The big screen merchants can handle re-sizing their browser window.

To use a fixed width, choose to define the size of your table in pixels. Try to keep the table within 500 pixels in width. It can be as deep as you like.

At this stage it cannot be stressed too much that you should try out various designs first using percentages, then pixels, and displaying your work in your browser with the window set to different sizes. See if you like what you see. See what happens to your design in each window size.

Another problem with tables is that they, and their contents, load as one item. This means that what I said above about a table being as deep as you like is not exactly true. The chapters of this book get rather long, and sometimes I add in screen shots. If my text runs to about six or seven screens, with three or four images, all of that must load onto your computer before you see anything at all if I have put it all in one table.

Some of these chapters would take 30 seconds or more to load if I put everything into one table, which is why I put the title of the longer chapters into a separate table, and then split up the rest of the material into separate tables, so that the viewer has something loaded onto the screen almost immediately.

One should always remember to put a paragraph tag after a table and before following text, otherwise on wide screens the following text might continue to display to the right of the table.

There are more problems, but for the moment, let us produce something, and meet our problems as they strike.

All decent page creation applications have table creating facilities. You will probably find that clicking a button on the toolbar either produces a default sized table, and/or a dialog box. Certainly this is the case with Netscape Composer (or Navigator Gold).

The options allow you to state the number of rows and columns in your table. You can set formatting to allow for the contents of cells to be right aligned, centered, or left aligned, and also for them to be top, center, or bottom aligned. You can set a background color for individual cells, and even set background images. Thus, you could create a gallery of pictures merely using a table with thick borders like picture frames.

You can set your borders to display or not, and give them values measured in pixels. You can also set your cell contents to be inset from the edges of the cell by setting a value, again in pixels, for the cell padding. You can also set space between cells.

The above options give you quite a lot of control over the table and its contents. However, once you have created the formatting of the table you have to fill it with objects. If you leave cells empty you will find your table will begin to take on a strange shape, and not display all the items you have so carefully set.

Remember what happens in your browser window to text with lots of spaces in it. Those spaces get ignored. The same happens in table cells. If there is nothing in a cell it will be collapsed in the browser. There are ways to circumvent this, and we will come to them shortly. Meanwhile, don't worry if at first things don't look right with your table.

We will start with a simple three column, two row table, and put some text and pictures in it.

This is our
picture gallery

The plane on the left is the Wright Flyer III. The first plane to achieve sustained controllable flight.

The plane on the far left is from early times. It didn't work.
The plane in the center was too unwieldy to fly properly and could not be controlled.

The code for the top row of the table is as follows:

<P><CENTER><TABLE BORDER=0 CELLPADDING=1 WIDTH=500 HEIGHT="50%" cols=3>

<TR>

<TD align=CENTER WIDTH=100> <H3><CENTER><FONT SIZE="+1" COLOR="#FF0000">This is our<BR>picture gallery</FONT></CENTER></H3></TD>

<TD> <P><IMG SRC="../../../pics/plane21.gif89" WIDTH=216 HEIGHT=89 ALIGN=bottom></TD>

<TD><P>The plane on the left is the Wright Flyer III. The first plane to achieve sustained controllable flight. </TD></TR>

 

 

The parts of the code which directly refer to the actual table are as follows:

<TABLE> is the tag that opens the table. This table contains three columns (cols=3), is 500 pixels wide, and its height is 50% that of the browser window (WIDTH=500 HEIGHT="50%"). Only it ends up being bigger because the images push the bounds of the cells. Confusing isn't it? The BORDER is turned off (set to 0 pixels).

The next part of the code sets the detail for the various rows and cells within the table. The <TR> tag sets the information for a Table Row. The <TD> tag displays the information for a cell.

You can also set a background colour for either the whole table (TABLE BGCOLOR="#ffffff"), the row (TR BGCOLOR ="#ffffff") or just a single cell (TD BGCOLOR ="#ffffff").

If you have trouble keeping your cells the right width there is a handy, but initially rather awkward workaround. You need to creatre a transparent image. The section on images tells you how to do this.

Insert the transparent image into the cell. Set the image size, so that it remains one pixel deep but as many pixels long as you want. I have done precisely this on these pages, to make sure the first column of the table stays the correct width. After all, there is nothing else in the first column. My actual code is as follows:

IMG SRC="../../../pics/trans.gif" WIDTH=114 HEIGHT=1

Using Netscape Composer

You can create tables in any of the standard page layout programs for the net. In Netscape, you need to open the editing suite, click the relevant formatting option from the menu, and then use the dialog boxes:

As you can see you have all the options you need. You can set number of columns and rows, border width and spacing between cells. Setting the Padding within the cells to a higher number would push the contents of the cell further away from the edge. The rest is self explanatory.

 

 

The Format, Table Info dialog box allows you to set more parameters, either for the whole table, for the row, or just for the individual cell.

The design problems are another matter, which will be left to a later section.

Education Home Page

Runway Index

Back to the Top

© John Clare. runway