Created
January 4, 2019 23:58
-
-
Save haraonline/0bfd91ff8aef9a2b110b2df680c4aada to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- SECTION 3: LECTURE 16 --> | |
{% macro render_dict(dictionary) %} | |
<table> | |
<tr> | |
<th>name</th> | |
<th>value</th> | |
<th>comments</th> | |
</tr> | |
{% for key, val in dictionary.items() %} | |
<tr> | |
<td>{{ key }}</td> | |
<td>{{ val }}</td> | |
{% if val<= 2 %} | |
<td>short</td> | |
{% elif val >= 2 and val <=3 %} | |
<td>medium</td> | |
{% else %} | |
<td style="color: red">long</td> | |
{% endif %} | |
</tr> | |
{% endfor %} | |
</table> | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment