Skip to content

Instantly share code, notes, and snippets.

@haraonline
Created January 4, 2019 22:50
Show Gist options
  • Save haraonline/1fa9d25849ec4519609be0b820a702c7 to your computer and use it in GitHub Desktop.
Save haraonline/1fa9d25849ec4519609be0b820a702c7 to your computer and use it in GitHub Desktop.
<!-- HTML FOR JINJA2 - PART 2 -->
<!-- USE WIHT THE PYTHON FILE PROVIDED -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>movie durations</title>
</head>
<body>
<h2>This Collection Belongs to {{ name }} </h2>
<table>
<tr>
<th> movie </th>
<th> length </th>
<th> comments </th>
</tr>
{% for movie, length in movies.items() %}
<tr>
<td> {{ movie }} </td>
<td> {{ length }} </td>
{% if length <= 2 %}
<td> short </td>
{% elif length >= 2 and length <=3 %}
<td> medium </td>
{% else %}
<td style="color: red">long</td>
{% endif %}
</tr>
{% endfor %}
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment