【发布时间】:2016-06-08 04:50:24
【问题描述】:
我实现了下表:
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
</head>
<body>{% extends 'base.html' %}
{% block content %}
<title></title>
{{ form.errors }}
{{ form.non_field_errors }}
<form action="{% url "start" %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">my list</div>
<div class="panel-body">
<p>some informations</p>
</div>
<table class="table table-striped">
<thead>
<tr width="100%">
<th align="left">1</th>
<th align="left">2</th>
<th align="left">3</th>
<th align="left">4</th>
<th align="left">5</th>
<th align="left">6</th>
<th align="left">7</th>
<th align="right">8</th>
<th align="left">9</th>
</tr>
</thead>
<tbody>
{% for Element in data %}
<tr width="100%">
<th align="left"><input type="checkbox" name="{{ Element.one }}" value="{{ Element.one }}"></th>
<th align="left"><input type="radio" name="startingpoint" value="{{ Element.one }}"></th>
<td align="left">{{ Element.two }}</td>
<td align="left">{{ Element.three }}</td>
<td align="left">{{ Element.four }}</td>
<td align="left">{{ Element.five }}</td>
<td align="left">{{ Element.six }}</td>
<td align="center">{{ Element.seven }}</td>
<td align="left">{{ Element.eight }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<input type="submit" value="Start" />
{% if form.errors %}
{% for field in form %}
{% for error in field.errors %}
<div class="alert alert-error">
<strong>{{ error|escape }}</strong>
</div>
{% endfor %}
{% endfor %}
{% for error in form.non_field_errors %}
<div class="alert alert-error">
<strong>{{ error|escape }}</strong>
</div>
{% endfor %}
{% endif %}
</form>
{% endblock %}
</body>
</html>
如何修改此表以通过单击标题使输出可排序?
先决条件是什么?是否也有一种非常简单的方法来使用引导主题?
【问题讨论】:
标签: django html-table jquery-ui-sortable