每次添加新的“待辦事項”專案時,我想自動添加一行。
這是它目前的樣子,

這是我想要的樣子- 在“CARD_1”下

我知道我哪里出錯了,從我的代碼中我們可以看到 for 回圈在一行下重新迭代。我想讓它在我的 Trello 卡更新時自動添加一行。
我的代碼:
<table BORDER=1 WIDTH="100%" CELLPADDING="4" CELLSPACING="3">
<thead>
<tr ALIGN="center">
<th COLSPAN="4" WIDTH="50%" CELLPADDING="4" CELLSPACING="3">
<br>
<h1>To-do list</h1>
</br>
</th>
</tr>
<tr ALIGN="center ">
<td ALIGN="left "><strong>Agenda</strong></td>
<td><strong>Not Started</strong></td>
<td><strong>In Progress</strong></td>
<td><strong>Complete</strong></td>
</tr>
</thead>
<tbody>
<tr>
{%for item in todo_items%}
<td>{{item.name}}</td>
<td><input type="checkbox" id="id" name="Tick" value="{{item.id}}"></td>
<td><input type="checkbox" id="id" name="Tick" value="{{item.id}}"></td>
<td><input type="checkbox" id="id" name="Tick" value="{{item.id}}"></td>
{%endfor%}
</tr>
{% for row in todo_items%}
<tr>
{%for rwo in cell%}
<td>{{cell}}</td>
{%endfor%}
</tr>
{%endfor%}
</tbody>
</table>
uj5u.com熱心網友回復:
您可以在回圈內移動“tr”標簽:
<tbody>
{%for item in todo_items%}
<tr>
<td>{{item.name}}</td>
<td><input type="checkbox" id="id" name="Tick" value="{{item.id}}"></td>
<td><input type="checkbox" id="id" name="Tick" value="{{item.id}}"></td>
<td><input type="checkbox" id="id" name="Tick" value="{{item.id}}"></td>
</tr>
{%endfor%}
</tbody>
因為它是定義新表行的“tr”。
Ps你想通過這個實作什么?
{% for row in todo_items%}
<tr>
{%for rwo in cell%}
<td>{{cell}}</td>
{%endfor%}
</tr>
{%endfor%}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/391082.html
