Information in an EJS-template can be represented with the following elements:
- formatting block (sections);
- links to images
The <div> </div> tags define the formatting sections in a template code. The content inside these tags must meet general formatting rules. Normally, the formatting is set with style classes. Style classes can be defined in a template code or in an external style table. A base print template is used as an external style table in BILLmanager.
The style class for the formatting section is set with the class or id attribute. The style class name is specified as an attribute purpose.
The following example shows how to describe a document name in the invoice template:
In the style table (the base template), the header class is described as follows:
The rules from the "header" class will be applied to the text in the formatting section: font size - 14 pixels, a bold text, padding-bottom - 30 pixels, and a center-aligned text.
The <table> </table> tags define a table. <tr> </tr> and <td> </td> define a standard cell and row in the table. <tr> </tr> define a row of cells in the table inside the tags <table> </table>. The <td> </td> tags define a row of cells in the table inside the tags <tr> </tr>. <th> </th> can be used instead of <td> </td>. A text inside the cell will be center-alligned and have bold style.
EJS-templates support standard HTML-tags and table attributes. The style class can also be applied to tables.
The service price is described in the invoice with the following code:
Two types of lists are supported: ordered and unordered. The <ul> </ul> tags represent an unordered list of items, each element included into the tags <li> </li>. A type can be defined by type:
The<ol> </ol> tags define an ordered list. Use the <li> tag to define list items. A type is defined by type. The reversed attribute allows you to write a descending list of numbered items. The start attribute specifies the start value for numbering the individual list items.
Links to images
Use the <img src=image_URL/> tag to add images into your EJS-template. The width and height attributes specify the width and height of an image in pixels.
The message template can contain a user avatar. Add it with the following code: