Quick Tip Quick Index

Tables: Cell Widths

OBJECTIVE: See how a three-column table looks when the cell width is not specified.

Let's take a three-column table and use two different methods for defining cell/column width. The table itself is a fixed width of 500 pixels. The first row is a column span of three, which makes it a nice area for a banner, other graphic, text, or a combination graphic and text.

It's always good to put alternate text in this tag. It gives those who have their graphics turned off a description of the image.

Use this column span area for introductory text, or for a graphic, or both. I used both, and in order for the text to fit next to it, used the align=left command in the image tag.

These three columns have default widths: nothing is specified

Because the graphic above has a white background, and I have a background color for the table (FFFFCC), I gave the image source area a border of 1. This is a good trick with photos and clip art that need to be set off from the background.

Notice that without specifying a width in either pixels or percentages, the largest cell of text will be the widest of the three, and so forth. I also used 15 pixels for cellpadding, because it's important to have white (negative) space between the content and the table border.

Because we want all the text to start at the top of the columns, we will give them a VALIGN=TOP command in the TD tags.



Back to Quick Tip Quick Index

Caveat: all tutorials are designed for the most frequently used browsers and systems, and may not work in all instances. All files on the parent directory are copyrighted by WebGrammar®. Any reproduction or editing by any means mechanical or electronic without the express written permission of the copyright holder is strictly prohibited. For further information, contact Judy Vorfeld