WIDTH attribute

The WIDTH attribute forces an explicit width of a form element.

Syntax

WIDTH = value [CHARACTERS|COLUMNS|POINTS|PIXELS]
  1. value is an integer that defines the width of the element.

Usage

By default, the width of an element is defined by the size of the form item tag. Use the WIDTH attribute, to define a specific width for a form item.

The WIDTH attribute is only available for some types of resizable form items, such as TABLE, TREE, IMAGE, WEBCOMPONENT.

Note:

As a general rule, consider not specifying a unit, to default to relative characters/lines/columns, instead of specifying exact pixels or points. This is especially important for mobile devices, where the screen resolution can significantly vary depending on the smartphone or tablet model.

If you don't specify a size unit for the WIDTH attribute, it defaults to CHARACTERS, which defines a width based on the characters size in the current font.

The CHARACTERS unit corresponds to the CSS "em" unit and specifies a width based on the font-size used by the form.

The PIXELS unit defines a number of CSS "px" pixels. In this context, the size of a pixel is defined by web standards and is independent of the screen resolution.

The POINTS unit specifies an absolute CSS "pt" size defined as follows: 72 points = 1 inch.

The COLUMNS unit defines a number of grid columns for IMAGE fields. The size of a grid column depends on the font-size used by the elements in the form. For TABLE/TREE containers, the COLUMNS units is interpreted as a number of first field columns.

For sizable items like IMAGE and WEBCOMPONENT, the default width is defined by the number of horizontal characters used in the form item tag. Overwrite this default by specifying the WIDTH attribute:

IMAGE img1: image1, WIDTH = 20, HEIGHT = 12;

For TABLE/TREE containers, the default width is defined by the fields/columns used in the table definition. Overwrite the default by specifying the WIDTH = x COLUMNS attribute. This will give a small initial width for tables with a large number of columns:

TABLE t1: table1, WIDTH = 5 COLUMNS;

The size of an element like TABLE, WEBCOMPONENT or IMAGE has an impact on the size of a modal window where the form of the table is displayed. However, regular windows will be sized from the window container, and the form content will adapt to it.