Template Code
<table>
<tr>
<th style="min-width: 70px;">Sl No.</th>
<th style="min-width: 350px;">Description</th>
<th style="min-width: 100px;">Date</th>
<th style="min-width: 50px;">Time</th>
<th style="min-width: 50px;">Status</th>
<th style="min-width: 50px;">Action</th>
</tr>
{% set count = [0] %}
{% for val in data['todos']%}
{% if count.append(count.pop() + 1) %}{% endif %}
<tr>
<td>{{count[0]}}</td>
<td>{{val['description']}}</td>
<td>{{val['date']}}</td>
<td>{{val['time']}}</td>
<td>{{val['status']}}</td>
<td>
<a class="fa fa-edit" href="#" style=" color: rgb(32, 252, 43);" ></a>
<a class="fa fa-trash-alt" href="http://localhost:5000/delete?todoid={{val['_id']}}" onmouseout="this.style.color=' rgb(248, 153, 153)'" onmouseover="this.style.color='rgb(241, 74, 74)'" style="padding-left:8%; color: rgb(248, 153, 153);"></a>
</td>
</tr>
{% endfor %}
</table>
Route code
@app.route('/delete', methods=["GET"])
def deleteTodo():
id = request.args.get('todoid')
print(id)