Tables

HoTMetaL PRO provides a convenient table editor to graphically edit tables. Tables are often used for formatting effects. For example, a table with one row and two cells filled with text side by side could be used to create the effect of two columns on a Web page. Similarly, names of items and text describing an item can be put side by side. Please use table effects with caution, as not all Web browsers support all features of the current table model. There should always be text-based alternatives to complex table formatting, and uncommon table attributes (such as background color) should be used with caution.

Inserting a table

You can insert a table by clicking on the TABLICON toolbar button or by choosing the Insert Table... command in the Tools menu.

This gives you a dialog box that lets you specify many different table options:

TABLEDIA

The [Insert] button in this dialog box will be grayed-out if it is invalid to insert a table at the current insertion point.

All of the properties described above can be set for an existing table by putting the insertion point inside the table and choosing Table Properties... from the Tools menu.

There are several other less common table properties that can be set by editing the attributes of the table. Place the insertion point to the right <TABLE> start-tag and choose Element Attributes... from the Markup menu. The attributes you can change are:

All tables in HoTMetaL PRO will be the same width as the document window.

Note: You can move to the next cell (horizontally or vertically) using the arrow (cursor) keys.

Properties

The properties described in this section will affect how the table is displayed in a browser, depending on the browser's capabilities.

The Cell Properties... command in the Tools menu lets you set properties for an individual cell.

CELLPROP

The Row Properties... command in the Tools menu lets you set properties for an entire row.

ROWPROP

Vertical alignment

The vertical alignment specifies whether a cell's content is aligned with the top, middle, or bottom of the cell. Vertical alignment can be set for a particular cell or row: a setting for a cell takes precedence over a row setting. To set the vertical alignment:

Horizontal alignment

Horizontal alignment (justification) specifies how the text in a table cell is aligned with the sides of the cell. Your choices are left, right, centered, and justify (that is, aligned on both sides). Horizontal alignment can be set for a particular cell or row: a setting for a cell takes precedence over a row setting. To set the vertical alignment:

Column/cell width

By default, when a column is displayed in a browser its width will be adjusted to the longest piece of text in any cell in the column. To set the width of a cell explicitly (this sets it for the whole column containing the cell):

The value you should enter for the width depends on what the browser expects. Netscape Navigator currently interprets a value that you enter as a number of (screen) pixels. Other browsers may interpret the width value differently, or even ignore it. An alternative is to use cell spanning instead: for example, a cell that spans over two cells will be displayed twice as wide as a normal cell.

If more than one cell in a column has a width setting, the longest one is used.

The width setting does not affect how the table is displayed by HoTMetaL PRO.

Wrapping

By default, the content of a cell will wrap when it is displayed in the browser, that is, it will be displayed over several lines rather than one long line. If you want wrapping turned off for the current row or cell:

To turn wrapping off for the current row: Some browsers may ignore these settings.

Background color

You can set the background color of a table row or cell. This feature is not supported by all browsers. To change the background color of a table row or cell:

The color of the background in the table cell or row will change in HoTMetaL PRO to reflect your choice of color.

Adding and deleting rows and columns

You can add or delete a single row or column using the Edit Table... command in the Tools menu.

When you select Edit Table... you will get a palette containing several buttons.

The six buttons along the bottom of the palette carry out the following operations:

If you insert a row or column, it adopts the defaults of the current row or column. You cannot delete a column if it has one or more cells that span an adjoining column; similarly, you cannot delete a row if has one or more cells that span an adjoining row. If you still want to perform the deletion, you will have to contract the spanning cells (see the next section, Spanning table cells).

Spanning table cells

The Edit Table... command in the Tools menu allows you to change the spanning of the cell containing the insertion point

Eight icons at the top of the palette extend and contract cells.

Extending cells

Extending a cell is like `knocking out the wall' between cells. The cell-extending icons, in clockwise order from the top, are:

There are some rules about extending cells:

Contracting cells

The cell-contracting icons, in clockwise order from the top, are:

Other table features

Not all of the following table features are supported in all browsers, so use them with caution.

Table caption

To give a table a caption:

Table header

Table cells are represented by the TD element. Cells can be changed to TH (table header) elements by putting the insertion point in the appropriate cells and choosing the Change Element... command from the Markup menu. If you simply wish to bold the text, we suggest that you insert a B or STRONG element inside the table cell(s) instead of changing the table cell element.

Reformatting tables

Sometimes tables that were not created with HoTMetaL PRO's graphical table editor will not display well in HoTMetaL PRO. Here are some things you can try to improve the appearance: