19 Editing tables

A table is considered as a structured element which has both a row structure and a column structure, as shown in the following example.

Today Last week
ChangeBuy SellBuy Sell
US $ 5,899 5,901 5,9415 5,9455
Yen 5,218 5,2245 5,271 5,2798
Ecu 6,5885 6,5938 6,5878 6,5966
Mark 3,397 3,3985 3,3999 3,4032
Swiss franc 3,9817 3,9859 4,0033 4,0098
Creating a new table
To create a table, choose the ``Other'' entry in the ``Insert'' menu, then the Table entry in the list of objects (see section 16).
Different types of tables
There are various types of tables. The type is determined by the attribute Type of table. Select the complete table, then activate the ``Attributes'' command and choose the attribute Type of table. This attribute can take the following values:

It is better to choose the value of the attribute as soon as it is created but this value can be changed at any time and as much as required. The contents of headings will not be removed even if the new value deletes them. The change in value is necessary when you want to handle columns and when columns have no headings.

Selection
The main structure of a table is the row structure. This can be seen if you select a character in a cell and press the Esc key several times: this allows you to travel up the structure of the table. The column structure is considered in a specific way, allowing similar operations to be performed on columns: by clicking on a column heading and then pressing the Esc key several times, you move across the column structure. This operation can only be performed on a table whose column headings are displayed (Table of type Columns or Rows and columns).
Adding a row or a column
A row or a column can be added in the same way as any other element in Thot: either with the ``Insert'' menu (see section 4.3.1) or with the Return key (see section 4.3.2). To create a column, first select a column heading or an entire column: then you can create a new column preceding or following the selected column. This implies that column headings are displayed (Table of type Columns or Rows and columns). To create a row, select either the heading of the next row or the last cell of the previous row or the complete next row or the complete previous row. Rows and columns can be simple or compound. The table above only contains simple rows. On the other hand, the two columns are compound and each of them contains two simple columns. However, these simple columns could also be compound on several levels. The same rules apply for rows.
Delete, cut, copy, paste a row or a column
The editing commands ``Delete'', ``Cut'', ``Copy'', ``Paste'' apply to simple and compound rows and columns in the same way as to any element of a document.
Modifying the size of a table
The height of a table is automatically computed by the editor according to the contents and the width of headings and cells. The user can choose the width with the usual command for changing the dimension of an element (Control key + middle mouse button, see section 8.3.3). This operation only applies to headings of simple columns (it has no effect on the other elements of the table) and it immediately changes the width of the whole corresponding simple column.
Extending a cell
The above operations allow the production of regular tables: each cell is at the intersection of a simple row and a simple column. However, it is sometimes necessary for a cell to span across several rows and/or columns. To do this, use the attributes Horiz. extension and Vertic. extension attributes which allow you to extend a cell to the right and downwards, respectively. These attributes only apply to a cell and not to a heading. Select the cell to be extended, then invoke the ``Attributes'' menu and choose the required attribute. Click with the right mouse button on another cell in the same simple row and to the right (Horiz. extension attribute) or another cell in the same column below the selected cell (Vertic. extension attribute). The selected cell is then extended to the clicked cell. The extension can go through several rows and/or columns. The cells hidden by an extended cell are not lost: when the extension is removed or reduced, the cells reappear. To cancel the extension of a cell, you have to perform the same operation as when you extend the cell except that you click on an element which is not a valid cell for the required extension. The extension attribute is then removed.
Modifying the aspect of a table
You can modify the aspect of a table with the commands used for changing the presentation (see section 8.3). Other options, specific to tables, are also offered through attributes; it deals with the aspect of different lines and frames and the position of the text within cells and headings:
Multi-page tables
When a table is too large to fit in a single page, the pagination process (see section 8.5) automatically cuts the table between two rows. Column headings are repeated at the top of the following page.

[Section 20] [Table of contents]