一個小問題,在django中頁面模板把變量放在td中,想要每十個td就換行,不是td里面內(nèi)容換行。<table id="scoretable"><tr>{% for i in td %}<td>{{i}}</td>{% endfor %}</tr></table>這樣幾十條td擠在一個tr中,全部是一橫排,而且td的內(nèi)容還是豎排,所以想要每十個td間換行。不是td里面內(nèi)容換行,而是td間!!這么寫只出來幾個數(shù)據(jù)?<table>{%for s in td%}{% if forloop.counter|divisibleby:10 %}<tr><td>{{s}}</td></tr>{% endif %}{% endfor %}</table>
table中td每十個換行
鴻蒙傳說
2019-02-09 13:12:30