Cell Shading (Tables)
How to shade cells conditionally with Jinja2
Cells in a .docx table can be conditionally shaded by passing a variable (such as a namespace) to the cellbg command that has the hex value for the desired color (with no hash symbol).
In this example, we establish the namespace "dd" and declare dd.namespace to equal the hex value for a shade of blue
1
{%p set dd=namespace(color=”4472C4”) %}
Copied!
Then in our .docx template, we create a cell that uses this variable to shade the cell
Last modified 1yr ago
Copy link