2. Example Tables The purpose of this chapter is to look at some example tables created with TableMaker, both to show what it can do, and to show how you can easily create tables such as these. The first example you have already seen - Table 1 of this manual (Tables 2-6 are very similar). This table consists of two frames. The first frame is the caption at the bottom of the table, while the second frame holds the body of the table. To create this table, first double click on the TableMaker icon. TableMaker starts by opening up a custom black & white screen, with a table containing no frames or pies. The borders of the table are on, with solid lines of 1 pixel width. The background color is set to be color 0 (black). Since those borders and that background color are what we want, we won't have to modify these parameters at all. Although we probably don't know right away how big a table will be required, usually the first step after creating the table is to resize the table to roughly the size thought to be needed. The final version of Table 1 is 265 pixels high and 600 pixels wide. Sizing the table is accomplished either by using the Table->Size menu item (the notation Table->Size means the Size subitem of the Table menu) and entering the desired parameters in the resulting requester, or by using the Table->Mouse Size menu item and adjusting the size by moving the mouse. Usually it's easiest to do rough adjustments using the mouse, with final adjustments entered through the requester for the highest precision. These operations, along with all the Table adjustments, are described in Chapter 5. TableMaker automatically creates the correct screen type according to your table size - high (640) or low (320) horizontal resolution, and interlaced (400) or normal (200) vertical mode. To change from low to high resolution, or normal to interlaced, you must use the Table->Size requester - the mouse can only change the screen type from high to low resolution or from interlaced back to normal. With the table of approximately the right size, it's now time to build the first frame. The caption frame is easiest, so we'll do it first. Using the Frame->New menu item, we'll create a new frame. As described in Chapter 6, up pops a requester labeled Frame Parameters which allows the specification of the width, height, positioning, and number of cells in the frame. The values inserted will create a frame with 1 row and 1 column, with height and width set ½ the size of the table, and positioned at the center of the table. These are not the parameters we want, so we use the gadgets in the requester to change these parameters to be 400 pixels wide, centered, and 20 pixels high, located 10 pixels above the bottom of the table. Hitting "OK" on the requester causes the frame to be created, with the word "Text" appearing in the one cell of our new frame. By using the centered horizontal and bottom-relative vertical positioning, the caption will stay centered at the bottom of our table as we resize it - making it easier to update the table as we complete it. To enter the text into the cell in this frame, we can either select the cell with the mouse and use the Cell->Text/Font menu item, or just double click on the cell. Either method brings up the Cell Text/Font requester, where we can click in the gadget containing "Text", hit `Right Amiga-X' or repeated backspaces to delete "Text", and then type in the desired caption - "Table 1, TableMaker Manual Organization." We then hit return to have TableMaker accept the change (if return is not hit, the change is not entered, to allow you to abort an editing operation). Using the up and down triangles next to the Font Name, we select the desired font (ruby 12). Once all the changes have been made, the "OK" button is hit with the mouse, the requester disappears, and the table is redrawn to reflect the new cell content. We then use the Cell->Colors requester to change the color of the text to use white as the foreground color, in mode JAM1. This is all we have to do to create the caption frame. Building the body frame is somewhat more complicated, as it has many more cells, and uses some manipulation of the parameters to make it appear as though the columns have different widths. First we create the frame with Frame->New, then enter parameters into the requester to create a frame 540 pixels wide (centered), and 220 pixels high, with a margin of 10 pixels from the top of the table. The number of rows is set to 10 and the number of columns is also set to 10. If these numbers seem strange, let's look at why they were selected. The most obvious question is, "Why 10 columns." The table appears to have 3 columns, of varying widths. Since I wanted 10% of the width to be used for the Chapter, 30% for the Title, and 60% for the Description, it was easy to see that a width from which I could build up these values would be 10% of the frame, achieved by having 10 columns. It's often useful to have a thicker border on the outside of a body frame, or as a separator between columns titles and their content. This technique was used in Table 1. Using the Frame->Border Param->Left menu item, I changed the width to 2 pixels, and used the Frame->Border Color->Left menu item to ensure the colors were correct. I then used Frame->Border Param->Copy three times to copy the left border to the top, right and bottom, using the gadget produced to indicate which border should be copied to. Copying borders is typically much faster than re-creating each border's parameters from scratch. The next step is to create the top row, which will serve as the column labels. Double-clicking inside the upper left corner brought up the Cell Text/Font requester, where I entered the text "Chap", and changed the font to diamond 12. I then used the Cell->Border menu subitems to create borders on the left, top, and bottom of width 2, and of width 1 on the right. Selecting the next cell to the right, we repeat the process, entering the text "Title", but not enabling the right border. Columns 3&4 will not contain any text, they're just there to reserve space for the text starting in column 2. Column 5 is identical to column 2 except for its text. Thus, using the Cell->Copy->Params menu item, we can copy all the parameters of the cell from column 2 (row 1) to column 5. Double-clicking on the new cell and entering "Description" in the text gadget completes the process for this cell. This is very typical of building tables with TableMaker - you use TableMaker's facilities to set the colors, font, borders, etc. for a cell; then use one of the Cell->Copy menu items to replicate that cell. A typical table will have a small number of unique cell parameter combinations. Column 3 (row 1) won't have any text, but does need borders. We turn its top and bottom borders on, with a width of 2 pixels. Columns 4 and 7-10 are all identical, so we can use Cell->Copy->Params to create them. Moving along to row 2, we'll first create the cell that contains the "1" indicating Chapter 1. Double-clicking on the cell allows us to enter the "1" and to change the font to diamond 12. All four borders need to be enabled, the top and left ones at width 2, the right and bottom at width 1. We then copy row 2 to row 3, change the text to read "2" and change the width of the top border back to 1. This format will then serve for the balance of column 1, so we use Copy->Cell->Params to copy into rows 4-10, and change the text of each to its proper parameter. In column 2, row 2, we double-click, enter "Introduction", and change the font to diamond 12 with style Under. Adjusting the borders for all on but the right one, with the top border having width 2 and the others 1, concludes this cell. We can copy this cell into column 2, row 3, change the top border width back to 1, and change the text to "Using TableMaker." This set of parameters holds for the remainder of the column, so we copy the parameters and then update the text. Columns 3,4, and 6-10 all just need borders - top and bottom, with those in row 2 having a top border width of 2 and the others having width 1. We create the first one of each type, then use the Copy function to update the others. This leaves only column 5. It is created essentially the same way as column 2, the only exception being the specific text entered, and the font which is set to topaz 8 with Italic style. Although this may read like a lot of steps, it's actually quite easy. Work through this example yourself using TableMaker, and you'll see you can easily create this kind of table in just a few minutes. It would be great if we knew exactly the final form of our tables as we started out, so we could calculate the number of rows and columns and the sizes ahead of time. Unfortunately, we're rarely able to do so. Thus, it is important to be able to modify a TableMaker table. One very common need is to enter a new row or column into a table. Selecting a cell and using the Cell->Insert Row or Cell->Insert Col menus will accomplish this function easily and quickly. Inserting a new row will copy the parameters of each new cell from the cell immediately preceding it. In most tables where the cell parameters are similar, this will eliminate the need to make a lot of cell parameter changes. Inserting a new column will copy the parameters of each new cell from a single cell, so slightly more work may be required. One should try to have the frame height and width be multiples of the number of rows and columns for proper spacing of the final row/column relative to the table border. Thus, if a row or column is inserted, you may need to adjust the size of the frame. TableMaker also allows the deletion of a row or column. The second example is shown here as Table 7. The tables built for this user's manual are examples of tables built as part of a desktop publishing environment - the tables were meant to be used as input to an integrated text & graphics document. Table 7, though included in this manual, was built to be used by itself. This table is a schedule of some children's activities, used to coordinate carpools. Ignoring the frame used to hold the caption (added for its inclusion in this manual), there are 4 frames and 2 pies in this table, though it could easily be built with 3 frames. The four frames are the title (Kid's Activity Schedule), the left-most "column" containing the days of the week, the top-most "row" containing the names of the kids, and the body of the table. The two pies show the distribution of activities by child, and the distribution of activities by day. The title was built using a horizontally centered frame with three rows, using the sapphire 19 bold font. The days of the week is a left-aligned frame with 1 column and 12 rows (1 for Monday, 4 for Tuesday, 2 for Wednesday, 2 for Thursday, 1 for Friday, and 2 for Saturday), using the ruby 12 bold font. The kids' names' frame is a right aligned, 1 row 3 column frame using the sapphire 14 font and centered text in each cell. Finally, the body frame is 3 columns and 12 rows, using topaz 8 as the font. Borders were created and copied to create solid lines between the columns and between the days, and dotted lines to separate activities on the same day. The sizes and locations of the frames were selected to make the tops of the days and body frames align, and the lefts of the names and body frames; with the day/body frames abutting horizontally and the name/body frames abutting vertically. The name and body frames could have been combined (they have the same cell size),but it would have required somewhat more care in calculating the locations and sizes of these frames. The first pie, with kid's activities by child, was created with the Pie->New menu item, followed by use of several Wedge menu items to adjust the first wedge. All wedges have a small explode value to make them visible in a monochrome print. If multiple colors were available for printing, this would not be necessary. The Wedge->Insert After item was used to create the second and third wedges. The fonts were adjusted to correspond to those used in the header frame, to make it easier to see the correspondence between the entries in the frame and the entries in the pie. The second pie was created in a similar fashion, using six wedges for each of the six days represented in the frame. Here again, the fonts were adjusted to correspond to the left frame's day of the week labels.