Terminal Tast

PAD

TAST accepts appropriate objects as part of it. The most simple is the Pad object. It adds text padding to its content so it can be aligned. The property children of the Pad object defines the content to be aligned. The children itself is another TAST, which is an array with the appropriate fields.

Name

Type

Description
type "Pad" Defines the type of the object. Mandatory.
width number The total minimal number of characters that the resulting text must occupy. Mandatory.
children array TAST of nodes to be padded. Mandatory.
alignment "left" | "right" | "center" Align text inside the given width to that direction. Default: "left".
character string A single character that will be used to pad the value. Default: "space".

Simple padding

By default pad aligns the content to the left and uses spaces to pad. Use the width to ensure the minimal number of characters that it must have. Mix strings and the Pad object inside the array if necessary.

Padding character

Change the padding character with the character property. It fills the space repeating the specified character.

Note that if you use more than one character as character property, the result is unexpected.

Alignments

Use the padding alignment property to change the alignment. The default value is 'left'; other options are 'right' and 'center.

Nesting

Pad children property is any valid test TAST. It allows create Pads inside Pads.