The invoice template below is an example taken from the Template Library. It illustrates how a template document can use several elements, such as tables (with and without borders and coloring), groups of repeating data, calculations, conditional statements, and other field formatting to produce a seamless and customized invoice at merge time.
1 A page header. Each page can have its own header or you can repeat headers across pages.
A borderless table containing the account information. You can apply text formatting, such as colors, font sizes, and so on, to any template text.
6 Although this is a summary field of the entire invoice amount, the content comes directly from a Salesforce data field and is not calculated on the template.
7 A conditional statement (IF statement) that checks whether the invoice total is over a specified amount and, if so, to add text related to free shipping. This text does not appear for invoices where the total is below the specified amount. [details] This is an example only. Do NOT use double brackets with IF statements.
8 The page footer repeats across pages.