[Answer]-How to customize a django form (adding multiple columns)


You can customize the form HTML using its fields, as shown in the documentation. You are doing this in an unusual way; normally you would have the template in a file instead of returning it from a function, but you can still do this:

from django.template import Context

def getdjtemplate():
    dj_template = """
        {% for field in form %}
        <tr>{{ field }}</tr>
        {% endfor %}
    return dj_template

form = old_form()
djtemplate = getdjtemplate()
newtmpl = Template(djtemplate)
c = Context({'form': form})

Leave a comment