我想知道是否有一種簡單的方法來實現我的HTML/Javascript表中的數字。HTML/Javascript中的數字行
下面是當前的代碼:
<table style="width:75%", border="2">
<th>Club</th>
<th>Points</th>
<th>Played Games</th>
{% for team, score, game in data %}
<tr>
<td><strong>{{team}}</strong> </td>
<td><emph> {{score}}</emph> <br/></td>
<td>{{game}}</td>
{% endfor %}
</tr>
</table>
我不會發布我的Python /瓶的代碼,因爲我不相信這是必要的。
我想要做的就是添加一個從1到最後的位置列。
請讓我知道!
謝謝!
真棒!這是答案。基本上,「loop.index」是做什麼的? –
它獲取當前循環索引。所以如果一個for循環正在進行,它將維護一個內部計數器並獲取它的值。 –