Home Forums General XMetaL Discussion Insert Table Button XSD Reply To: Insert Table Button XSD

Derek Read

Reply to: Insert Table Button XSD

Unlike other types of elements where you can specify a “treat as” type (images, lists, paragraphs) for an element with any name there is no equivalent setting for “treat as table”.

However, the functionality for inserting tables is enabled automatically when XMetaL Author recognizes that your schema defines either an HTML or CALS table, with no further work to be done. This also means that this functionality cannot be hooked up to an arbitrary table type that is not one of those two.

What is recognized as HTML or CALS is flexible to some degree but works best when one of those standards is followed closely.

At minimum, your schema needs to define the following elements for XMetaL Author to support HTML tables:
table, tr, td

When elements or attributes (such as th or @width) are not defined the software attempts to compensate by disabling portions of the Table Properties dialog so the use can still edit the table. If for example, @width is not allowed, then the software will not allow the user to drag a table's borders to change its size (because there is no way to record it in the appropriate attribute) and the “cell width” and “column width” settings in the Table Properties dialog will be disabled.

At minimum, your schema needs to define the following elements for XMetaL Author to support CALS tables:
table, row, entry

For other sets of elements you wish to display as a table it is possible to build a custom “insert table” form (XFT) but it would need to build the table and insert it (there are various APIs that will let you do that but you can't use either of InsertTable or InsertCALSTable). Also, none of the standard table manipulation functions (both those in the UI and APIs) can be used on such a table after it has been inserted. This means that in order to allow someone to delete a row, move a row, move a column (and other things for which there are dedicated table manipulation APIs) you would need to duplicate those and the scripts for doing that will be difficult to write, and in some cases some of the built-in functionality for CALS and HTML tables will be impossible to reproduce.

To display a set of elements as a table (something that is not HTML or CALS) you must also use the CSS display property. It only supports “table”, “table-row” and “table-cell” and also affects display only (setting these does not enable any editing functionality).

Long term we are considering adding a “treat as table” feature so that arbitrary groups of elements can gain support for display as a table and basic table manipulation functionality through configuration (possibly like the other CTM “treat-as” settings). However, as most schema use HTML or CALS this has so far been a low priority.

Reply

Products
Downloads
Support