Amaya

## Editing tables

Amaya does not contain a separate table editor. To Amaya, a table is simply a structure described by the (X)HTML document type definition (DTD), like any other element, and it is edited as such. The same commands apply to tables as to other HTML structures. However, a few specific commands have been added for more convenient manipulations.

### Creating a new table

To create a new table:

1. Move the cursor to the location in the document where you want to create the table.
2. Click the Table button in the Elements tool, or choose Table from the Insert menu.The Table dialog displays.
3. Enter the initial number of rows and columns for the new table, and specify the border width, etc.
4. Click the Confirm button. Amaya generates a graphical representation of the table.
5. The cursor is automatically placed in the first cell.
6. To insert content into other cells, click inside a cell and then insert the appropriate text, image, etc. Use the arrow keys to navigate from one cell to another.
7. You can also edit the text of the table caption, add it if not already there, or remove it if it is not needed.

### Adding a new column

To add a new column to a table:

1. To create a new column to the left of an existing cell, select the Insert a column entry in the Tools/Edit table submenu, or use the corresponding button in the Elements tool , or type `Ctrl-t Ctrl-b`.
2. To create a new column to the right of an existing cell, select the Append a column entry in the Tools/Edit table submenu, or use the corresponding button in the Elements tool , or type `Ctrl-t Ctrl-a`.

In XML mode, a new column can also be added to a table using the `Enter` key. When a whole cell is selected (use `F2`), pressing the `Enter` key creates a new cell and its corresponding column to the right of the selected cell.

### Removing, copying, pasting a column

When a whole column is selected, you can delete it, copy it, cut it and paste it before or after another column, in the same or in another table.

To select a column:

1. Use the Select column entry in the Tools/Edit table submenu (`Ctrl-t Ctrl-c`).
2. You can also start the selection in a cell and extend to another cell in the same column (for example start in Cell 1.2 and stop in Cell 2.2). Amaya changes to column selection mode. Hitting the `F2` key extends the selection to the whole column.

Cell 1.1 | Cell 1.2 | Cell 1.3
Cell 2.1 | Cell 2.2 | Cell 2.3
Cell 3.1 | Cell 3.2 | Cell 3.3

When a whole column is selected, use the usual commands to copy, delete or cut it.

Two specific commands are available to paste a column:

1. To paste a column before an existing column, click at the beginning of a cell in the existing column and use item Paste before of the Tools/Edit table submenu (`Ctrl-t Ctrl-p`).
2. To paste a column after an existing column, move the cursor to the end of a cell in the existing column and use item Paste after of the Tools/Edit table submenu (`Ctrl-t Ctrl-v`).

### Adding a new row

There are two specific commands to create new rows in a table:

1. To create a new row above an existing row, select Insert a row from the Tools/Edit table submenu (`Ctrl-t Ctrl-i`), or the corresponding button in the Elements tool .
2. To create a new row below an existing row, select Append a row from the Tools/Edit table submenu (`Ctrl t Ctrl n`), or the corresponding button in the Elements tool .

In XML mode, a new row can also be easily added to a table using the `Enter` key. When a whole row is selected (use key `F2` for that), pressing the `Enter` key create a new row after the selected row.

### Removing, copying, pasting a row

When a whole row is selected, it is possible to delete it, to copy it, to cut it and to paste it.

To select a row:

1. Use the Select row entry in the Tools/Edit table submenu (`Ctrl-t Ctrl-r`).
2. You can also start the selection in a cell. Hitting the `F2` key extends the selection to the enclosing row.

When a whole row is selected, you can delete it, copy it, or cut it with the usual commands.

Two specific commands are available to paste a row:

1. To paste a row before an existing row, use the Paste before item of the Tools/Edit table submenu (`Ctrl-t Ctrl-p`).
2. To paste a row after an existing row, use the Paste after item of the Tools/Edit table submenu (`Ctrl-t Ctrl-v`).

### Extending a cell

To extend a cell, the simplest method is to select the set of cells to be merged by dragging and to call the Merge cells command in the Tools/Edit table submenu, or to click the corresponding button in the Elements tool .

Four other specific commands allow you to extend or shrink a cell:

- To extend a cell to the next cell at the right, select Join with the cell at the right in the Tools/Edit table submenu (`Ctrl-t Ctrl-e`).
- To extend a cell to the next cell below, select Join with the cell below in the Tools/Edit table submenu (`Ctrl-t Ctrl-j`).
- To shrink an horizontally extended cell by one column, select Shrink horizontal extend in the Tools/Edit table submenu (`Ctrl-t Ctrl-s`), or click the corresponding button in the Elements tool .
- To shrink a vertically extended cell by one position, select Shrink vertical extend in the Tools/Edit table submenu (`Ctrl-t Ctrl-m`), or click the corresponding button in the Elements tool .

Cell extensions can be also changed by editing the `colspan` and `rowspan` attributes.

### Adding a new table body (tbody)

Function not available in the Amaya Lite profile.

- To create a new table body above an existing table body, click at the beginning of the first cell in the first row of the table body and select the tbody item in the Insert/Table submenu.
- To create a new table body below an existing table body, move the cursor to the end of the last cell in the last row of the table body and select the tbody item in the Insert/Table submenu.

In XML mode, new table bodies can also be easily added to a table using the `Enter` key. When a whole table body is selected (use `F2`), pressing the `Enter` key creates a new table body after the selected table body.

Note: Amaya implements HTML 4.0 tables. A table may include several table bodies (`tbody`), table headings (`thead`), and table footers (`tfoot`).

### Adding something after a table

Many element types may be inserted within table cells. When you click a button in the Elements tool or you select an entry in the Insert menu, Amaya will try to insert the selected element into the cell that contains the insert point.

To solve that problem in XML mode, you can select the table element (use `F2`) and press the `Enter` key. Amaya creates a new paragraph after the selected table. This paragraph may be replaced by another element.

Another method is to select the table element (use `F2`) and use the Append command in the Edit menu or in the contextual menu.