7 Tables

Some types of information are much better presented in tables rather than as running text. You should consider presenting any numerical information, or lists, in table format. Tables are easily created and edited, and are ideal for creating a wide range of forms and reports.

This chapter shows you how to:

The information in this section can also be applied to designing spreadsheet documents. Simply select the area of spreadsheet you want to format, and add grids, borders and backgrounds as if it were a table.

Table basics

Tables are a way of presenting information which is neat and easily understandable. Transport timetable information and the ingredients in a recipe are two everyday examples of information which can be presented in tables. Forms such as software registration cards or school worksheets can also be created as tables.

Tables can range from a simple two-column list, to large and detailed documents.

The language of tables

Some basic terms are used within Fireworkz and throughout the computer world to refer to the parts which make up a table. They are the same as the words used to describe the content of a spreadsheet. These terms are used throughout this chapter.

A table is made up of vertical columns and horizontal rows. The intersections of these are called cells, and this is where you enter your text or data.

Cells can be shown more clearly by a grid, a pattern of lines showing the boundary between each row and column. Each cell can also have its own border, and cells can be given a background colour.

Adding tables

Tables are easily added to any Fireworkz document. You can add tables to both letter and worksheet documents.

To add a table to a document:

  1. Place the caret at the place where you want the table to start.
  2. Choose Table from the Edit menu. The Insert table dialogue box will appear.
  3. Enter the number of columns and the number of rows you want in the table. If you are not sure exactly how many you will need, enter the approximate number; its easy to add or remove rows and columns later.
  4. Click Insert in the dialogue box.
  5. The table will appear. A new style will be added to the document. For the first table in a document it will be called .Table1; for subsequent tables it will have an appropriate number.

You can now go on to edit and customise your table. See Editing table layouts.

Editing table layouts

Editing table layouts is made easy by Fireworkz. Most changes can be made by selecting the part of the table you want to change, and dragging it to the new size in the ruler.

If it is not already displayed, you should switch on the Side ruler in the View control dialogue box. This makes it much easier to resize rows.

Editing the cell layout

The cell layout for each table is defined in the corresponding style .TableN which is automatically created when you add a table to your document. These are the default table settings, which you will probably want to alter:

You should make any changes which you want to apply to the whole table by altering the settings in the ruler when no area of the table is selected.

The type style, border, colours and the grid are altered using the Style dialogue box by editing the appropriate table style or creating new styles and applying them to the table.

Merging two cells

You may wish to remove column boundaries in some rows of your table, perhaps because a row is being used as a heading or break in the table. The method described here is one way to do this: you could also straddle the two cells.

  1. Select the left of the two cells you want to merge.
  2. Point at the column width marker at its righthand side.
  3. Press the Ctrl key and the left mouse button and drag the column width marker to the edge of the righthand of the two cells.
  4. When you release the left mouse button you will see that the cell boundary has disappeared. You can repeat this process across as many columns as you need, but if you want to widen a cell over several columns you have to do it from right to left, column by column. This is because you can only drag one column border at a time in this way.

Straddling cells

There is a simple and convenient way to merge a pair of cells in a row. This is called straddling. To do this:

  1. Select the two cells which you wish to straddle.
  2. Point at the column border between the two cells.
  3. Control-double click (or, RISC OS only, Adjust double-click).
  4. The two cells will merge.

Adding extra rows and columns

There are two options for adding extra rows and columns to a table. You may either insert additional rows and columns at a point within the table, or add rows and columns to the end of an existing table.

To insert extra rows within a table:

  1. Place the caret within the table at the point where you want to insert an extra row.
  2. Display the Rows sub-menu from the Edit menu.
  3. Choose Insert from that sub-menu.
  4. An extra row will be inserted into the table.

To insert extra columns within a table:

  1. Place the caret within the table at the point where you want to insert an extra row or column.
  2. Display the Columns sub-menu from the Edit menu.
  3. Choose Insert from that sub-menu.
  4. An extra column will be inserted into the table.

To add rows to the bottom of a table:

  1. Place the caret in the last row of the table
  2. Display the Rows sub-menu from the Edit menu.
  3. Choose Add from the Row sub-menu. The Add Rows dialogue box will be displayed.
  4. Enter the number of rows to add by typing in the writable field or by using the arrows.
  5. Click Add. The extra rows will be added. They will be displayed in the table style for this table.

To add columns to the right of a table:

  1. Place the caret in the last column of the table
  2. Display the Columns sub-menu from the Edit menu.
  3. Choose Add from the Columns sub-menu. The Add Columns dialogue box will be displayed.
  4. Enter the number of columns to add by typing in the writable field or by using the arrows.
  5. Click Add. The extra columns will be added. They will be displayed in the table style for this table.

Removing redundant rows and columns

To remove a row or column from the table:

  1. Select the row or column to remove by clicking in the top or leftmost cell and dragging down to the bottom or far right.
  2. Choose Delete from the Columns or Rows sub-menu as appropriate. The columns or rows will be removed from the table.

Changing column width

Tables are usually created with all their columns of equal width. However, you may need one or more columns to be wider than the others. For example, if you made a table to display students marks in a series of tests, you would need a wide column for their names and narrower columns for the marks.

To change column width:

  1. Place the caret in the column you want to change. If you want to change more than one column, select all the columns you want to change by putting the caret in the upper leftmost cell and dragging down to the lower rightmost.
  2. Point at the column width marker in the ruler.
  3. When the pointer turns into two vertical lines with arrows pointing out from them, click Select and drag this new pointer along to the place where you want the column to end. The status line will give you precise information about the measurement.
  4. The table will now appear with the extended or shrunken column you have altered.

You can change the width of part of a column, by selecting only those cells whose width you want to change and following the process outlined above.

Repositioning the table on the page

You can alter column widths to reposition the table on the page. Tables automatically start in the second column. By adjusting the width of the first (leftmost) column on the page, you can align your table with your text or margins.

  1. Make sure that the column border is displayed.
  2. Select all the rows of the column to the left of the table, as many rows as there are rows in the table. This will ensure that it is only the table which is repositioned, and not the rest of your text.
  3. Point at the column width marker for this first column, and drag it to the required position.
  4. Your table will be repositioned on the page.

Changing row height

The process for changing row height is exactly like that for changing columns, but uses the side ruler.

However the height of the entire row will change; you cannot select part of a row and change its height.

Choosing the width or height for a column or row

The Auto Width and Auto Height facilities make it possible to make columns and rows exactly the right width to contain their largest member. Using this facility allows you to tidy up your table.

To use Auto Width:

  1. Select the column whose width you want to adjust (or individual cells in the column).
  2. Point at the column width marker for the column whose width you want to adjust. The pointer will change into double arrows.
  3. Double-click on the column border.
  4. The column(s) will be resized to the best width according to the widest entry.

The process for setting automatic row height is identical but you should select a row and double-click on its marker. This effectively clears the fixed row height setting attached to a row, so that the row height will alter automatically to track the tallest paragraph in the row.

Designing grids, boxes and borders

Most tables are easier to read if there is a pattern of lines, or grid, dividing the columns and rows. Fireworkz enables you to design the grid containing the information in your table using the Box editor and the Style editor.

The grid exists in an space between each cell. Each cell also has a border, which is its boundary. You can highlight cells, columns and rows by displaying the border. Either create a style, based on the table style, or apply an effect to the cells you want to change.

The default style for tables is a black grid surrounding every cell.

The example and template files in the Examples directory contain several different table styles which you can use in your own document.

Using background colours

Adding a background colour to a row or column is a good way of emphasising it. Background colours are also added using either the Style editor or the Effects command.

To add a background colour to a table style:

  1. Create a new style based on your existing table style. Call it something like Table colour.
  2. Go to the Colour section of the Style dialogue box.
  3. Turn on Background colour. Choose the colour you want for the background, either by clickin the Colour button in this group to use the standard colour selector, or by clicking on one of the pre-defined colour buttons in the palette, or by typing in RGB values, or use the arrows to enter RGB values.
  4. Click Apply.
  5. Select the part of the table you want to appear in the new colour, and apply the Table colour style to it.
  6. The selected cells will appear in the new colour.

Boxes and borders

As the finishing touch to your table or form you may want to add a border or box around some areas of your page.

You may add an external box or internal grid lines to areas of cells or paragraphs. You can apply a box style to individual cells, groups of cells, whole tables or whole documents.

Boxes

Boxes are external lines around a rectangular group of cells or paragraphs.

There are several different line styles available for drawing boxes. These are shown in the Line style section of the Box dialogue box. They are:

Setting the size of box lines

The width of lines used in boxes is based on the width of line set in the Grid width setting of the Paper dialogue box. The thin and dotted lines are the same as this width, the narrow line half of this width and the thick line twice this width.

Change the setting of the grid width to the width you want in points. If you do this, and make the measurement much larger, you should check the text at the beginning and end of paragraphs; a large grid width setting could cut into the tops and bottoms of letters if there is insufficient paragraph spacing to cover the grid width.

If you have large text in shallow paragraphs or rows, you may occasionally find that the grid is drawn over the tops or bottoms of the letters, which you will see as the tops or bottoms of letters being clipped off. If you have no grid displayed this will manifest itself as the top of the first or bottom of the last lines in paragraphs being missing. This problem usually appears on screen.

There are two possible solutions to this problem if it arises:

Creating boxes

To add a box:

  1. Select the area of table that you want to add a box to.
  2. Display the Box dialogue box by choosing Box from the Style menu.
  3. Select Outside.
  4. Choose a line style by clicking on its button in the Line style section of the dialogue box.
  5. Choose a colour for the box using the colour selection tools.
  6. Click Apply. A box will appear around the edge of the selected area.

Grid lines

You can add grid lines to any set of selected cells or paragraphs using the Box dialogue box. The line styles available for grid lines are the same as for boxes.

To do this:

  1. Select the area you want to add the grid to.
  2. Display the Box dialogue box by choosing Box from the Style menu.
  3. Select All to add the line to all sides of all cells/paragraphs, or the required combination of vertical and horizontal lines.
  4. Choose the line style and colour for the grid lines.
  5. Click on Apply. The grid lines will be added to the selected area as directed.

Boxes and the grid

When you draw a box around a group of cells, it is based on the positioning of the grid between the cells and their neighbours.

If you are creating a complex document, where the width of columns varies as tables and text appear in the document, you may encounter some problems with the drawing of boxes.

The simple solution to this is to keep an extra row in the same column format as the table above and below the table. These act as a buffer between the table and the rest of the document and ensure that its box is always displayed and printed correctly.

You should not encounter this problem where tables are added to documents where the surrounding column is the full width of the page; it only occurs when tables are embedded in worksheet type documents with variable column widths.

Removing boxes and grid lines

There are two options for removing boxes, borders and grid lines from tables or from areas within tables.

Using the Regions editor

You can use the Regions editor to remove grids and boxes from your documents. You can do this because grids, boxes and so on are applied to the document as effects, and are therefore controlled by the Regions editor.

If you use the Regions editor to remove a region, it will remove the whole of that grid or box. To do this:

  1. Click in the area containing the grid or box you want to remove.
  2. Display the Regions sub-menu from the Style menu, and choose Edit.
  3. Click the In or Out buttons until you see that the grid or box you want to remove is described in the status line. You will also see that the region containing the grid or box is selected in the document.
  4. When you have the right region selected, click Delete. The effect will be removed from the document

Using the transparent/invisible option

A much more flexible option for editing the grids and boxes in tables or elsewhere in documents is to use the transparent/invisible line facility in the Box editor.

  1. Select the table or the part of the table or document from which you want to remove the line, grid or box.
  2. Choose Box from the Style menu.
  3. Set up the box editor so that it affects the lines you want to change, for example if you want to remove a box from outside a selection of cells you would choose Outside.
  4. Click the Line style button representing transparent/invisible (this is the button with no marking on it).
  5. Click Apply.
  6. The table should be redrawn with the lines you selected no longer displayed.

Entering text into tables

Typing directly into tables

To type directly into a table, place the caret in the cell you want to type in and enter your text. This will enter the information as text.

Entering numerical live data into tables

You may enter data into tables in Fireworkz as data, via the editing line. This makes the data live and enables you to perform calculations upon it. To enter live data in a cell:

  1. Click on the cell.
  2. Press F2 or click in the formula line. The caret will appear in the formula line.
  3. Type in the number or data, or enter a formula.
  4. Tick tool button Click the Tick tool button on the toolbar (or press Return↵) to confirm the data and enter it in the cell.

Using styles and effects in tables

Text will appear in the main text style of your document, with the margins defined in the Table style, but you can modify that style to suit.

Useful points to consider are:

Grid patterns and background colours are also defined as styles. Remember that you can apply more than one style to an area if different attributes are set in each style.

You should define grids and background colours as separate styles to the main table style you are using for the table. This makes it much easier to change the look of the table without altering the basic way it is laid out.

Importing data into tables

Rather than type your data directly into the table, you may want to import the data from another source and place it directly in the cells of a table.

Data for import should be in CSV format.

Drag the CSV file icon on to the document window, or on Windows, choose Insert file from the File menu.

A dialogue box will appear presenting the following options:

If you added the file as a table, use the Style editor to turn grid lines and background colours on or off as required.

Edit the table layout in the usual way.