This discussion applies to both stand-alone Text Fields and Value Crosses set to “Text Field mode. These can contain static text, variable values given by ObjectName.property, or (in the case of Value Crosses in Text mode), properties of the attached object via $.property.
The Text Fields in this post can be found in the model “HTML text boxes - Part 1.ebs” on my Ebsilon Tips OneDrive.
Text Field Fonts
With a Text Field, you can set a font, but that font is given to all the text, as in these two samples:
But if you set the Text Field to use “HTML Syntax”, you gain a LOT of flexibility:
Here are some examples, which can be found in this folder on my OneDrive.
Change fonts WITHIN the text
This is a Text Field with a variety of fonts:
which has this text:
Text Formatting
Bold font is set by surrounding the text with the <b> and </b> tags.
Italic font is set by surrounding the text with the <i> and </i> tags.
The type of font, size, and color are set with the <font> tag, with the attributes given as noted in the example. Use </font> to mark the end of the formatted section.
White space
HTML ignores all whitespace larger than one space. If you need to force an extra space, type (meaning Non-Breaking Space).
Newline characters are ignored. To force a line break, type <br>
Setting Background Color
As is often the case, the price you pay for flexibility is complexity. To set a background color in a Text Field in HTML Syntax mode, you need to put the text into a Table, then set the background color of the table:
The text for this is:
where
“bgcolor” means “background color”
<tr> and </tr> mark the beginning and end of a row in the table (“tr” means “table row”)
<td> and </td> mark the beginning and end of a cell in the row (“td” means “table data”)
Tables - more options
That table thus has a one row, with one cell in that row. Of course, it is possible to have multiple rows and cells:
which is done by bounding each row with <tr> and </tr> tags, and each cell within the row with <td> and </td> tags, as shown here for the first row:
By default, borders are not visible, but can be activated with the ‘border’ keyword and a line width:
You can also merge cells with the “colspan” keyword, indicating how many columns the specified cell should span:
That example also shows that you can change the background color for an entire row or a specific cell by setting “bgcolor” where desired:
Colors can be given by name, or by hexadecimal code (two characters each for red, green, and blue).
I've edited the post to include a link to the model containing the examples, and also to show how to add borders to a table.