[問題] html table 裡的tr順序不對
<table>
<tr><th>Product</th><th>For Merchant</th><th>Number</th><th>Start Time</th><th>End Time</th></tr>
{% for psub in product_subscriptions %}
<tr><td><a href="{{ path('ypg_ct_user_role_product_profile',{'role': role_url, 'productid': psub.product.id}) }}">{{ psub.product }}</a></td><td>{{ psub.merchant }}</td><td>{{ psub.number }}</td>
<td>{{ psub.starttime|date('Y-M-d') }}</td><td>{{ psub.endtime|date('Y-M-d') }}</td>
</tr>
{% else %}
<tr>No product subscription is found</tr>
{% endfor %}
</table>
--
其實code很簡單,我的問題是:
當我的DATA裡面沒有product時,會SHOW "No product subscription is found"
但是他會SHOW在我的 <th>那個ROW的上面
有人知道為什麼嗎? 或是該怎麼解決
Output:
No product subscription is found
Product For Merchant Number Start Time End Time
我想要的是:
Product For Merchant Number Start Time End Time
No product subscription is found
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 76.89.178.171
→
12/07 08:00, , 1F
12/07 08:00, 1F
→
12/07 09:26, , 2F
12/07 09:26, 2F
推
12/08 03:26, , 3F
12/08 03:26, 3F
→
12/08 03:27, , 4F
12/08 03:27, 4F
→
12/08 05:15, , 5F
12/08 05:15, 5F
推
12/08 06:09, , 6F
12/08 06:09, 6F