!pad

Widens the text in its body to length characters with a filler at its start or end.

!padMicronode

#Attributes

lengthRequiredImplicit
The length to pad up to, in characters. A whole number, 0 or more.
Can be written as shorthand: !pad:value
with
The filler. Omitted or empty, it is one space: an attribute value is trimmed, so a space cannot be written.
Default
side
Which end of the text the filler goes on.
startend
Defaultstart

#Allowed content

Body { }Inline Chalk content, flattened to plain text

#Examples

table{
    Specimen | Mass (g)
    !pad:4{7}(with: 0) | 12.1
    !pad:4{12}(with: 0) | 9.8
}

#Notes

  • !pad:6{42}(with: 0) gives 000042; !pad:6{42}(with: .; side: end) gives 42.....
  • A filler longer than one character is repeated and cut to fit: !pad:7{42}(with: ab) gives ababa42.
  • Text already at or beyond the length is unchanged.
  • The page collapses runs of spaces as it sets text, so space padding does not line up a column; a visible filler does.
  • The body is read as plain text, so markup in it is dropped. A {{…}} expression in it is read at its current value.

Last updated