WIDTH attribute

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

Syntax

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

Usage

By default, the width of an element is defined by the size of the form item tag in a grid-based layout, or by the type of the form item in a stack-based layout. Use the WIDTH attribute to define a specific width for a form item.

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 according to the smartphone or tablet model.

Grid-based layout

For sizable items like IMAGE, 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 columns used in the table layout. 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;

In a grid-based layout, if you don't specify a size unit, it defaults to CHARACTERS, which defines a width based on the characters size in the current font.

Stack-based layout

In a stack-based layout, the WIDTH attribute cannot be used: The width of form element are automatically computed.