<li id="magic_{{ num }}"> {{ form.as_table }} <button type="button" class="remove"> <span class="ui-icon ui-icon-closethick"></span> </button> </li>