Output control

Field width

An optional display width specification for a column.

Example 4-15. Input field widths

$opts['fdd']['col_name']['width'] = '100px';
$opts['fdd']['col_name']['width'] = ($opts['fdd']['col_name']['trimlen'] * 8).'px';

Maximum field length

Maximum length of input boxes displayed for Add / Change record mode may be set as pixels (px).

Example 4-16. Field sizes

$opts['fdd']['col_name']['maxlen'] = '100px';
$opts['fdd']['col_name']['maxlen'] = '150px'; 

Textarea sizes

If the above setting does not work for you, you are probably attempting to change textarea size. It is also possible to specify the size of a textarea used to give multi-line input. Try something like:

Example 4-17. Textarea field height & width

$opts['fdd']['col_name']['textarea']['rows'] = 1;
$opts['fdd']['col_name']['textarea']['cols'] = 40;

Character length limit

If a table contains a number of text columns which each contain quite a bit of text, the table will likely scroll off the screen. This can be prevented by displaying only a portion of the content from a particular column.

For example, to display only the first 30 characters from a column named 'explanation', add the following:

Example 4-18. Character length limit

$opts['fdd']['explanation']['trimlen'] = 30; 

You may find it useful to limit the number of characters displayed for one or more columns. This option is approximately equivalent to the following PHP statement:
if (strlen($value) > $trimlen) {
	echo substr($value, 0, $trimlen - 3) . '...';
}

Wrapping

The 'nowrap' option is essentially equivalent to the HTML markup <td nowrap>.

Example 4-19. Wrapping

$opts['fdd']['col_name']['nowrap'] = true;
$opts['fdd']['col_name']['nowrap'] = false;

Print mask

A string that is used by sprintf() to format field output. For more information about this function usage, please refer to its manual page in PHP documentation.

Example 4-20. Print mask field definition

$opts['fdd']['col_name']['mask'] = '%%';     // a literal percent character
$opts['fdd']['col_name']['mask'] = '%01.2f'; // currency or floating-point number
$opts['fdd']['col_name']['mask'] = '%.10s';  // trim string to 10 characters

Date masks

Date mask is string that is used to format date and/or time fields using PHP's function call. You can use ['datemask'] option to format date and time using date() function or you can use ['strftimemask'] option to format date and time using strftime() function. See function's manual pages for valid formatting characters.

Example 4-21. Date mask field definitions

$opts['fdd']['col_name']['datemask'] = 'r';
Note that currently only fields displaying is implemented. Entering date fields concerning to these masks will be implemented in the nearly future.