8. Tables

Click the The "Add table" toolbar button ("Add table") toolbar button to add a new table element after caret position[1]. This button displays a menu letting you choose between a plain table or a table starting with a header row (where first row child element has attribute role="header").

Figure 8-1. The menu displayed by the "Add table" toolbar button
The menu displayed by the "Add table" toolbar button

In TEI, a p element may have a table child element. However, this element arrangement does not make much sense. That's why the above menu entries will take great care to never add a table inside a paragraph.

Selecting any of the above menu entries displays a dialog box letting you choose how many rows and columns the new table will initially have.

Figure 8-2. The "Table Size" dialog box
The "Table Size" dialog box

There is not need to manually set or update the rows and cols attribute of a table element. If needed, XMLmind XML Editor will automatically do this for you each time you'll save your document to disk.

Modifying a table

The other buttons found in the "Table" section of the toolbar let you modify a table.

The "Table column" menu

Easy column selection. Suffice to click anywhere inside a cell element belonging to a column to operate on this column.

The "Th "Sort Rows" menu item Sort Rows" menu entry displays a dialog box letting you sort the rows of the table according to the string values of the cells of current column (that is, the column to which belongs the cell containing the caret; see above easy column selection).

The "Table row" menu

Easy row selection. Suffice to click anywhere inside a cell element belonging to a row to operate on this row.

The "Table cell" menu

Easy cell selection. Suffice to click anywhere inside a cell element to operate on this cell.


[1] More precisely, the new table is added after node selection (if any) or after caret, at a document location where it is valid to do so.