We configure and save the design of a row, column and cell as a .json template. These can be used to format or highlight rows, column and cells. Most of the parameters for configuring a row, column or cell template recur from configuring a table template, and thus you can read about each parameter in this article, since the logic for configuration is the same.
However, there are some minor differences, and these will be elaborated throughout this article. Before starting your configuration, use the empty template and save it as .json file. Whether the template is applied to a row, column or cell depends on its location in the Content folder. Learn more about the logic in the folders here.
Design element
Inside the Design
element, we define the parameters for the cell, column or row template. As mentioned, the parameters for doing so recur from the configuration of a table template, and this includes setting background color, font, Word style, Excel cell formatting, line spacing, alignment, margins and borders. Notice that only values that are actually needed should be defined.
Besides these parameters, we can set the width and height. In cells, we can use both. In column, we support only width, and in rows, we support only height. These must be defined in points.
Specific formatting for first cell of a row and column
Just like the ability to do a specific formatting for first/last row/column in a table design, we can specify the first cell of a row or column in the template. The parameter FirstCell
can be used to define what should apply for only the first cell of the selected row or column. Inside this parameter, we have the same options as for the design of the entire row or column.
In the example below, the column template is used to apply white borders. However, the white borders should not be applied to the first cell in the column, since this works as a header and has another background color than rest of the table. Thus, we use this to define the color of the border for the first cell to not be white, but follow its background color:
{
"Design": {
"FirstCell": {
"Borders": {
"Vertical": {
"Color": {
"Key": "HeaderRow"
},
"BorderWeight": "Thin",
"BorderWeightOverridePp": null,
"Type": "Solid",
"Visible": true
}
}
},
"Borders": {
"Vertical": {
"Color": {
"Key": "BorderWhite"
},
"BorderWeight": "Thick",
"BorderWeightOverridePp": null,
"Type": "Solid",
"Visible": true
}
}
},
"OverrideColorTheme": null,
"DefaultColorTheme": "ClientName.json",
"TemplateName": null
}
At the end of the .json, we refer to the color template and define the template name.
Define the name of the .json file that contains the color template as a string value. This ensures that we can define the keys from the color template.
The name of the template must be defined as a string value as well. If this is set to null
, the name of the .json file will be shown in the menu. Is not supported for cell templates.
Comments
0 comments
Article is closed for comments.