6.4. Hidden elements submenu
To create elements in the document head, use the Insert/Hidden elements submenu. These elements are
displayed only in the structure and source views. The structure view should then be open. Put the cursor
at the desired position and choose the element type from the Hidden elements submenu.
The Hidden elements submenu also enables you to create comments. Comments are shown only in the
structure and source views, but they can be inserted at any position in the document.
6.5. Generated elements
Some HTML elements are constituted by several other elements of different types. For instance, a table
usually contains a caption (caption), several rows (tr), and several cells (td or th) in each row.
When Amaya creates such elements, it also creates their components. To create a table Amaya displays
a dialog that lets you choose to create it with or without a caption. You can also choose the number of
rows and columns you want and other presentation options. The insertion point is placed automatically in
the first generated cell. You can enter the content of that component immediately or later. You can move
to the next (empty) component with the mouse or with the arrow keys.
HTML defines inline elements that allow you to attach style to character strings. See Creating HTML
Style Elements to create such elements.
6.6. The Enter key
When you are writing a new document or a new part in a document, you can create elements sequentially
by pressing the Enter key. The current element is terminated and a new one is created immediately after.
The type of the new element depends on the HTML DTD.
When the cursor is at the end of a preformatted or a division element (pre or div), hitting the Enter key
creates a new line in the pre or a new paragraph in the div.
In some cases the behaviour of the Enter key depends on the current editing mode:
• XML mode:
To create a paragraph after a pre or a division after a div, you have to select the whole pre or
div element with the F2 key and to press Enter. In the same way, you can create a new
paragraph after a table by selecting the whole table and pressing Enter.
When a whole element like h2 or li is selected the Enter key creates a new h2 or li after.
• Text mode:
When the cursor is at the beginning or at the end of a list item (li), a new sibling list item
element of same type is created, instead of a new paragraph within the list item. In addition, in
an empty list item, the Enter key creates a paragraph that breaks the list.
When the cursor is within elements such as p, address, dt, h1, h2, etc. (they are called block
elements) the Enter key splits the element into two sibling elements of same type.
When the insertion point is in HTML elements such as strong, em, code, span, a, etc. (they are
called inline elements), the Enter key splits the inline element and the event is transmitted to
the parent element. As inline elements may be nested in a HTML structure, the split may
happen at several levels, until the event reaches a block or list item element, which processes
the event as explained above.
When the Enter key is hit at the beginning or at the end of a block element, a new paragraph (p
element) is created, whatever the type of the current block element.
When the new element created is simply a paragraph, you can change the element type by selecting the
desired type from the Insert menu or by clicking the corresponding button in the Element tool. You can
also keep typing and change the element type later on.
Amaya User Manual
16