Skip to content

Instantly share code, notes, and snippets.

@haraonline
Last active January 4, 2019 23:26
Show Gist options
  • Save haraonline/fc5586d3501b39b546ae028f7680357c to your computer and use it in GitHub Desktop.
Save haraonline/fc5586d3501b39b546ae028f7680357c to your computer and use it in GitHub Desktop.
<!-- HTML FOR SECTION 3: LECTURE 14 -->
<!-- ADDED CSS USING UR_FOR METHOD TO THIS HTML FILE IN LINE 10 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>movie durations</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
<h2>This Collection Belongs to {{ name }} </h2>
<!--the following url_for is ony for your understanding. dont include this in your projects-->
<h3> Path to the css file: {{ url_for('static', filename='css/styles.css') }} </h3>
<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