You can make a template field to display a value that results from a calculation based on several table fields. To achieve this outcome, you can define a formula in a formula field to get the result and map that formula field with a document template field. 

For more information about adding formula field in tables, see Formula Fields.