We asked for it, and we got it. A welcome addition to FrontPage 1.1 is the inclusion of table support. Using tables, you can really control the layout of a page in a great number of ways, placing content and images where you want them. Well sort of.
In the HTML tag family, tables are still growing up. For this reason, browsers handle tables differently. Some older browsers don't recognize tables at all; they leave your hard layout work lying in the dust, displaying a jumble of text and images. You should keep several different browsers around to test your tables as you design them and make compromises when you can.
There is good news, though. The latest versions of Internet Explorer and Netscape handle tables quite well. Each of these browsers has its own nifty little tricks up its sleeve-particularly Internet Explorer, which gives you the opportunity to specify different colors for individual cells. The proposed tags for Internet Explorer 3.0 sound even wilder. You'll have the capability to specify a separate background image for each cell as well. Tables are the way to go if you want to create a fancy layout.
A table has several elements, and to understand them is to understand the terminology needed to create them. Figure 13.1 shows an example of a basic table.
Figure 13.1 : The basic elements of a table are rows,
columns, cells, borders, and a caption.
You'll see the following elements:
You enter a basic table in your page first by choosing the Insert | Table command. This command invokes the Insert Table dialog, from which you can specify several table attributes.
By default, FrontPage creates a table that contains two columns and two rows and spans the entire width of your page. The table is aligned in the center of your page, has no border, has a cell padding of 1, and has a cell spacing of 2 pixels.
You can specify several different values for your basic table. Follow these steps:
TIP |
You can preview your settings by clicking the Apply button in the Table Properties dialog. |
The Insert Table dialog enables you to specify the number of rows and columns your table contains. You also can specify how the table aligns on the page and choose a table width in percentage of screen or pixels. You can specify the overall cell padding and cell spacing values in this dialog, too.
You set the number of rows or columns in the Size section of the Insert Table dialog. First, enter the number of rows in the Rows field, or use the up and down arrows to select a value from 1 to 100. Then, enter the number of columns in the Columns field, or use its up and down arrows to select a value from 1 to 100. Figure 13.3 shows a table that contains five rows and three columns.
Figure 13.3 : A basic table with five rows and three columns.
The Table Alignment setting is the first in the Layout section
of the Insert Table dialog. This setting is not for the alignment
of the contents within the cells; it controls how the entire table
is aligned on your page.
NOTE |
If you want to design tables that display fairly consistently in several browsers, you need to make some compromises. Some browsers don't recognize the right-alignment setting and align the table to the left side of the page instead. |
To choose a table alignment, select one of the following options from the Alignment drop-down listbox in the Layout section of the dialog:
Figure 13.4 shows examples of left, center, and right alignment applied to the table in our example. The Alignment setting won't be noticeable unless the table width is set to a value of less than 100 percent.
Figure 13.4 : Tables aligned to the left, center, and right of a page.
The Border Size setting controls the width of the border that appears around the outer edge of the table. Many people use tables to enhance page layout, placing graphics and text in fixed areas of the page. Most commonly, the tables used in this manner don't have borders; using them would detract from the effect of the layout. When you specify a border of 0, the FrontPage Editor displays the borders of the table and cells in dotted lines. Not to worry-this is just a guide for you to place your content in the cells. When you view the table in other browsers, you won't see those border designations. Figure 13.5 shows the table from Figure 13.3 with a border added. Cell padding and cell spacing are set to 0 in this example.
Figure 13.5 : A border is added to the table.
The Border Size setting is found in the Layout section of the Insert Table dialog. To set the border size, you can do one of two things:
The Cell Padding setting controls how far from the edge of the cell's border its contents appear. To see what I mean, compare the top table in Figure 13.6 to the middle table, which does not use cell padding.
Figure 13.6 : Examples of cell padding and cell spacing.
TIP |
For text content, you probably will want to use cell padding and cell spacing to improve the appearance of your tables. If you want graphics to get as close to each other as possible to give the illusion that the table is one solid graphic, you might want to set cell padding and spacing to 0. |
You specify Cell Padding settings in the Layout section of the Insert Table dialog in one of two ways:
The Cell Spacing setting controls the width of the borders between cells (the row and column dividers, so to speak). Refer to Figure 13.6, where the center and bottom tables have cell spacing added. Compare them to the top table, which does not.
To set cell spacing, you use one of the following two methods:
You can format tables to different widths by using the Width section of the Table Properties dialog. Figure 13.7 shows some examples of different table widths that are center aligned. You set table width in percentage of screen or in pixels.
Figure 13.7 : You can specify a table width other than
100 percent in the Table Properties dialog.
TIP |
In most cases, you'll want to specify the table width in percentage of screen because users may have their browser windows sized differently instead of maximized. Also, some users browse the Internet in 640¥480 resolution, whereas others use 800¥600 or 1024¥768. If you specify the width in percentage of screen, the table resizes to accommodate the user's browser window. On the other hand, if you're adding graphics to your tables, pixel settings help you visualize the table layout before the graphics are inserted. You should note, however, that when a user resizes his browser window or views it in a different resolution, portions of your table may not be visible. Perhaps a good rule of thumb here is to size your pixel table width for 640¥480 resolution, and size your graphics accordingly. You should be fairly safe with that setting in most cases. |
To specify table width, follow these steps:
Several new tags in HTML 3.0 enable you to enhance a table's appearance.
Table 13.1 lists these tags. You add these attributes by specifying
extended attributes for the table.
NOTE |
You won't be able to view the results of these extended attributes in the FrontPage Editor. You can, however, view the results in Internet Explorer 2.0 or 3.0, as well as Netscape 3.0. |
Name | Value | Function |
ALIGN | BLEEDLEFT | Aligns the table to the left edge of the window border. |
ALIGN | BLEEDRIGHT | Aligns the table to the right edge of the window border. |
COLSPEC | Cn, Ln, or | Specifies column alignment and Rn each column "in the table. Acceptable values are Cn, Ln, and Rn. A table with four columns, for example, could have the following value entry: L20 R25 C100 C150.The first column will be 20 pixels wide and left- aligned, the second column will be 25 pixels wide and right-aligned, the third column will be 100 pixels wide and centered, and the fourth column will be 150 pixels wide and centered. |
FRAME | ABOVE | Displays a border at the top of the table frame. |
FRAME | BELOW | Displays a border at the bottom of the table frame. |
FRAME | BOX | Displays a border on all sides of the table frame. |
FRAME | HSIDES | Displays a border on the top and bottom sides of the table frame. |
FRAME | LHS | Displays a border on the left of the table frame. |
FRAME | RHS | Displays a border on the right of the table frame. |
FRAME | VOID | Removes all outside table borders. |
FRAME | VSIDES | Displays a border on the left and right sides of the table frame. This is an Internet Explorer 3.0 feature. |
RULES | none | Removes all interior table borders. |
RULES | ALL | Displays a border around all rows and columns. |
RULES | BASIC | Displays horizontal borders between the table head, table body, and table foot. |
RULES | COLS | Displays horizontal borders between all table columns. |
RULES | ROWS | Displays horizontal borders between all table rows. |
To add extended attributes for a table, follow these steps:
If you want to create your own table, create a new page in the FrontPage Editor. Use the example shown in Figure 13.9 to try a table yourself.
Figure 13.9 : Insert a table with five rows and three
columns.
To insert the table, follow these steps:
After you place your table on your page, it's easy to place text, images, bots, or forms into the cells. Start first with a basic text table to learn how easy it is. Enter the text shown in Figure 13.9 into your table, or make up your own example.
To enter text into your table, follow these steps:
After you place a basic table on your page, you begin to edit
the contents in the table. In the process, you can assign different
properties to any or all of the cells in the table. You'll run
into situations where you might need to add a row or two, reformat
widths of cells, align your text differently, and all sorts of
other things. Have no fear; it's easy to edit the tables to enhance
appearance.
TIP |
If you're working along with these examples, you can use the Edit | Undo command to clear your work quickly and easily. |
You can edit table properties in the Table Properties dialog shown in Figure 13.10. The basic steps follow:
Figure 13.10: Use the Table Properties dialog to change the settings of your table.
All the settings you specified when you created the table can be modified, with the exception of the number of rows and columns. The procedures to modify them are the same as outlined earlier in "Setting Table Properties."
You're looking at the table you just created and saying, "So, what's the big deal? Just looks like a standard table to me!" As you are about to learn, you can reformat the cells in your table in a variety of ways.
You can apply cell formatting to a single cell or to multiple cells at once. To do this, you need to select the cells first. You can select a group of cells, an entire row or column, or the entire table.
To apply cell formatting to cells, you just select the cells you want to apply the formatting to before you choose the Edit | Properties or Cell Properties command.
To select a single cell or multiple cells, follow these steps:
You can select an entire row or multiple rows at a time. A good example for doing this is formatting all the cells in the row as header cells.
To select an entire row, use one of these methods:
If you want to change the width of an entire column of cells, you can select one or more columns using one of these methods:
You also can apply cell formatting to every cell in your table. To select the entire table, use one of these methods:
After you select your cells, you use the Cell Properties dialog to change the properties of the cells. This dialog enables you to set the properties of a single cell or a group of selected cells in your table. (See Figure 13.11.) The settings you can choose from are described in the following sections.
Figure 13.11: The Cell Properties dialog enables you
to reformat your cells in a variety of ways.
You set horizontal alignment in the Layout portion of the Cell Properties dialog. You can choose left, center, or right alignment. The first row of the table in Figure 13.12 shows examples of these alignments.
Figure 13.12: Contents of cells can be aligned horizontally and vertically.
To specify horizontal alignment, follow these steps:
You also set vertical alignment in the Layout portion of the Cell Properties dialog. You can choose to align the contents of your cell at the top, middle, or bottom sides of the cell. Refer to the second row of Figure 13.12 for examples of these types of alignments.
To specify vertical alignment, follow these steps:
It's typical to assign the top row and/or the first column in your table as header cells. Figure 13.13 shows a table where the top row is formatted as header cells.
Figure 13.13: Header cells enable you to distinguish
what the contents of the cells represent.
NOTE |
When you format cells as header cells, the contents of the cell become what appears to be emphasized (or bold) text. You won't be able to use the Bold button on the Format toolbar to remove the bold formatting from the header cell. You'll need to convert the header cells back to normal cells for this. You can also italicize, underline, or use fixed-width font in a header cell. |
To change selected cells into header cells, enable the Header Cell checkbox in the Layout section of the Cell Properties dialog. To remove header cell formatting, disable the Header Cell checkbox.
Notice that there is a lot of wasted space in the table shown in Figure 13.13. You can specify a minimum width for the cells in your tables. Before you get too deep into this, though, you should know that some browsers ignore cell width settings and automatically size columns to fit the content in the cells below them. If you don't want this to happen, there are ways to work around it, which I'll describe in a bit.
To specify the minimum width of a cell, follow these steps:
It's important to note that the values entered for minimum cell widths are exactly that: minimums. If all the column widths in your table total less than 100 percent, the columns expand as necessary to accommodate cell contents until the table reaches 100 percent width. If all the column widths do total 100 percent, the contents of the cells wrap around as necessary. Figure 13.14 shows a table in which the first and second columns are formatted for 15 percent width, and the last column is formatted for 70 percent width. Notice that the contents of the second column wrapped to accommodate the contents instead of taking width away from the longer row.
The same rule applies for tables that have a pixel width. If your table was created with a 500 pixel width, for example, format each of the column widths so that their values total 500 pixels. Notice in Figure 13.15 that words too large to display in the column are cut off. The same applies to graphics, so you should coordinate your graphics sizes with the same values you specify in your columns.
Figure 13.15: For tables that specify pixel width, format
the columns to equal the same total.
Now for a little oddity. Suppose that you try to get fancy with table layout for graphics. You format the first row in your table as shown here:
Col 1 = 10% Col 2 = 10% Col 3 = 10% Col 4 = 70%
So far, so good: It totals 100 percent. The table should be happy. Let's say for the next row, you format the cells this way:
Col 1 = 25% Col 2 = 25% Col 3 = 25% Col 4 = 25%
Again, they all add up to 100 percent. Will these two rows work together? Well, take a look at the first table in Figure 13.16 to see what happens.
Figure 13.16: Don't combine different cell widths in
the same column. Strange things happen.
As you can see, strange things brew up. The table expands to fit the widest cell in each column. The first three columns in the second row take precedence over the three columns in the first row because they are wider. The last column in the first row takes precedence over the last column in the second row for the same reason. So, what you originally hoped would be two rows that spanned 100 percent in different ways becomes a table that is 145 percent wide (three columns at 25 percent plus one column at 70 percent). Note that 45 percent of your table will go off the screen. Situations like this make table layout tedious at times, but you can compensate with cell spanning, merging, or splitting.
You can make a cell or group of cells span more than one row or column. Select an entire row, an entire column, or a range of contiguous cells, as shown in the top table in Figure 13.17, and choose the Table | Merge Cells command. The bottom table shows what the cells look like after they are merged.
Figure 13.17: You can merge cells for advanced layout.
Splitting cells is the opposite of merging cells. You can split a cell into multiple rows or columns. Figure 13.18 shows an example of this. The top table, which has two columns and two rows, was split using the Split Cells command. The first column in the first row was split into four columns, and the second column in the second row was split into six rows. The bottom table of Figure 13.18 shows the results.
Figure 13.18: Cells can be split into multiple rows or columns.
To split a cell, follow these steps:
After you split cells, it sometimes can be a little confusing as to how to select them. How do you find out which row the big area is in? And how do you select the smaller cells to the right of that big cell?
In Figure 13.19, you easily can see how to find out. Position the insertion point at the left edge of the table near the row you want to select. The cursor becomes a small arrow. Click to select the row.
Figure 13.19: Selecting rows after splitting.
As you can see in the top table of Figure 13.19, the first row (which contains the cell that you split into columns) is still intact as a row.
Now look at the center table in the figure. The second row contains that big cell. To select it and its corresponding cell in the second column, place the mouse at the left side of the table, directly opposite the cell in the second row of the second column.
To select the cells in rows 3 through 7 of the table, position the mouse at the left side of the table, directly opposite the cell or cells you want to select. Click to select the row. The bottom table in Figure 13.19 shows this.
A similar situation occurs with the cells that were split into columns. The first column contains the big cell and first cell in the first row, because those were the cells that originally were there. The second through fourth columns (the ones you split) don't have any additional cells associated with them in the example. All three of these cells are selected in the center table shown in Figure 13.20. And the fifth column is still intact as a column, as shown in the bottom table of Figure 13.20.
Figure 13.20: Selecting columns after splitting.
You can insert a new cell into your table. When you do this, the contents of the other cells shift over. You might need to reformat cell widths in that row to compensate. There might be situations in which you want this to occur, but you might be better off splitting the cell that appears before the cell you want to insert. That way, your table layout isn't affected.
To insert a cell, follow these steps:
You also can insert new rows or columns into your tables by using the Insert Rows or Columns dialog.
To insert new columns, follow these steps:
To insert new rows, follow these steps:
NOTE |
When you insert rows or columns in your table, the new row uses the same number of cells as the row that you select to insert before or after. This is important to keep in mind when you insert new rows in tables that have split and merged cells. |
You also can create a nested table-a table within a table. It is sometimes easier to create more complex tables using this approach. Follow these steps:
It's pretty easy to delete cells from your table. Actually, all you have to do is select the cells, rows, or columns you want to delete and press the Del key. To delete the entire table, select it by choosing the Table | Select Table command or by double-clicking in the selection bar in the left margin of your page. The entire table appears in reverse video, and then you can delete it.
You add extended attributes to cells in a similar manner as described earlier in "Using Extended Table Attributes." Tables 13.2 and 13.3 list the attributes you can add. Attributes that apply to cells fall in three categories: TH (for header cells), TR (for rows), and TD (for data cells).
Name | Value | Function |
COLALIGN | LEFT | Left-aligns contents of all cells in the column. |
COLALIGN | RIGHT | Right-aligns contents of all cells in the column cell. |
Name | Value | Function |
BACKGROUND | URL | Defines a background image for the cell. Cell contents appear above the background image. |
BGCOLOR | #rrggbb | Defines a background color for the cell by its hexadecimal value. |
BGCOLOR | colorname | Defines a background color for the cell by color name. Allowed color names are listed in Figure D.18 in appendix D. |
BORDERCOLOR | #rrggbb | Defines a border color in hexadecimal value. |
BORDERCOLOR | colorname | Defines a border color by name. Allowed color names are listed in Figure D.18 in appendix D. |
BORDERCOLORDARK | #rrggbb | In a border with a 3-D appearance, selects the dark color by hexadecimal value. |
BORDERCOLORDARK | colorname | In a border with a 3-D appearance, selects the dark color by color name. Acceptable values are shown in Figure D.18 in appendix D. |
BORDERCOLORLIGHT | #rrggbb | In a border with a 3-D appearance, selects the light color by hexadecimal value. |
BORDERCOLORLIGHT | colorname | In a border with a 3-D appearance, selects the light color by color name. Acceptable values are shown in Figure D.18 in appendix D. |
To add extended attributes to a cell or group of cells, follow these steps:
Figure 13.21 shows an example of applying Internet Explorer's BGCOLOR attribute to cells. The attributes were added to each cell individually. When you apply the extended attributes, you don't see the results in the FrontPage Editor (the top table in Figure 13.21). If you view your tables in Internet Explorer 2.0, however, you'll be able to see the results. Check out the bottom table in the figure.
Tables don't always have a caption, but, in some cases, they are necessary. They help you point out what the table is about. When you apply a caption to a table, it actually becomes part of the table instead of a separate line of text. Generally, a table caption uses one line.
To add a caption to a table, follow these steps:
To select a table caption, move the pointer to the left of the table caption. Double-click the mouse to select it.
You insert an image into a table in the same manner you would insert an image onto any part of your page. The only special considerations you really need to remember are that the table columns are sized sufficiently to handle the image. You don't want to insert a graphic that is too big for the column, which is why I recommend sizing your columns for pixels rather than percentage when you apply cell properties. To demonstrate this and the other items I've covered in this chapter, build the fancy table in the next section.
Build a quick example of a table that combines some of what you've learned here:
When you're finished, your table should look like Figure 13.22. Links can be assigned to the images in the upper right portion of the main table, and you can add text to the other cells in the table to describe the things to which you are linking.
Figure 13.22: A fancier table, with graphics and alignment.
I hope I've got the wheels turning now. I think you can see from what you've learned in this chapter that tables aren't just for data anymore. They go a long way in dressing up your pages and can sometimes compensate for using image maps on your pages.
You've covered a lot of ground in this chapter. You learned what tables are and the many ways you can use them. You built a basic table and applied table properties to it. And then, after learning the many ways in which you can format cells, you got a taste of building a more advanced table, complete with graphics. You also learned ways in which you can give your tables a fresh look for those using Internet Explorer for a browser. Well done-you deserve a hearty pat on the back!
In the next chapter, you'll learn about one of the latest hot features of pages: frames. The chapter is aptly titled "Frames-Pages with Split Personalities," because that's exactly what they are. You'll see when you get there.
For information that relates to this chapter, refer to the following chapters:
| Are there any other compromises that can be made for browsers that don't support tables very well? |
| One workaround is to build your table as you normally would and then do a screen capture of it while viewing the table in the FrontPage Editor or another browser that supports tables. Insert the graphic of the table onto your page instead of the actual table.**For browsers that don't support graphics, or for folks who have graphics turned off, create a text alternative of your table on another page. Use formatted paragraphs or typewriter font to align the contents of the page nice and neat. Then provide a link to the text version on the page that contains your original table. |
| I inserted a table at the very beginning of my page, and now I want to add text up there. I can't figure out how to do that, because my cursor won't go above the table. Help!!! |
| If your table has a caption, position the insertion point at the beginning of the caption and then choose one of the Insert | Paragraph or Insert | Heading commands to enter your text. If your table doesn't have a caption, insert one, enter its contents, and then insert your paragraph. |
| I'm using a background that puts a really neat design at the left side of my page. I used paragraph alignment to position my text beyond that border, but some browsers put the text at the beginning of the page over the border. How can I fix that? |
| Put your page contents in a table. Create a table that contains one row and two columns and spans 100 percent of the page width. Size the left column wide enough to cover the border, and size the right column for the remainder of the page. For more information, see Chapter 17, "Real-Life Examples," because this is one of the examples you'll be working on. There are many more tips there. |
| I formatted my tables for 50 percent width and aligned them to the right side of my page. Now I want to put text next to it but I can't. What gives? |
| Tables are an entity unto themselves. The table may be formatted to display in a portion of your screen, but the areas to the right and left are also a part of that table. What you can do is insert another table on your page that spans 100 percent page width and has one row and two columns. Size each column for 50 percent width. Next, reformat your original table for 100 percent width. Cut or copy it to the Clipboard and paste it in one of the cells in the new table. Then you can add your text in the other empty cell. |