[問題] html table 裡的tr順序不對

看板Web_Design作者 (葛蘭特希爾)時間13年前 (2012/12/07 06:32), 編輯推噓2(204)
留言6則, 4人參與, 最新討論串1/1
<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
tr裡沒td
12/07 08:00, 1F

12/07 09:26, , 2F
一樓正姊
12/07 09:26, 2F

12/08 03:26, , 3F
剛好想到如果加了td他應該會顯示在第一個column那
12/08 03:26, 3F

12/08 03:27, , 4F
如果原PO想要放在整個ROW的中間要怎麼做@@
12/08 03:27, 4F

12/08 05:15, , 5F
colspan 再text-align:center
12/08 05:15, 5F

12/08 06:09, , 6F
喔對對對 thanks
12/08 06:09, 6F
文章代碼(AID): #1GmHq6eI (Web_Design)