mutable template added

This commit is contained in:
pErfEcto2
2023-05-11 11:08:00 +03:00
parent d8da3239dd
commit 8dab84f38d
15 changed files with 20 additions and 3 deletions
@@ -1,3 +1,9 @@
h1 { h1 {
color: green; color: green;
} }
table, tr, th {
width: 50%;
border: 1px solid;
margin-left: auto;
margin-right: auto;
}
@@ -1,4 +1,4 @@
<!DOCTYPE <html> <!DOCTYPE html>
<html> <html>
<head> <head>
{% load static %} {% load static %}
@@ -7,5 +7,15 @@
</head> </head>
<body> <body>
<h1>{{ text }}</h1> <h1>{{ text }}</h1>
<table>
{% for i in list %}
<tr>
<th>{{ i }}</th>
<th>{% widthratio i 1 i %}</th>
</tr>
{% endfor %}
</table>
</body> </body>
</html> </html>
@@ -5,7 +5,8 @@ from django.shortcuts import render
def index(request): def index(request):
context = { context = {
"text": "test" "text": "test",
"list": range(101)
} }
return HttpResponse(render(request, "polls/index.html", context)) return HttpResponse(render(request, "polls/index.html", context))