我有一个index.html文件:
{% for item in data %}
<tr>
<td>{{item[0]}}</td>
<td>{{item[1]}}</td>
<td>{{item[2]}}</td>
<td>{{item[3]}}</td>
<td>{{item[4]}}</td>
<td>{{item[5]}}</td>
<td>{{item[6]}}</td>
<td>{{item[7]}}</td>
<td>{{item[8]}}</td>
<td>{{item[9]}}</td>
<td>{{item[10]}}</td>
<td>
<form action="{{ url_for('history') }}" method="POST">
<button type="submit"> History </button>
</form>
</td>
</tr>
{% endfor %}
在app.py中:
@app.route('/history', methods=['GET', 'POST'])
def history():
return render_template('history.html')
我的网页上有一个带有许多行的表格,每一行都有一个标着“历史记录”的按钮。由于现在每个按钮都执行相同的动作并指向history(),如何区分原始点击来自哪一行数据?