title: Multiple fields on the same row in Django
body: <p>I'd like to display a row with a label, a textfield and a checkbox for each item in a database. I've managed to do this except for the checkbox that's on a new line. I wan't:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;Label&lt;/td&gt;
      &lt;td&gt;Input&lt;/td&gt;
      &lt;td&gt;Checkbox&lt;/td&gt;
  &lt;tr&gt;
  </code></pre>
  
  <p>But all I get is:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;Label&lt;/td&gt;
      &lt;td&gt;Input&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Checkbox&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Anyone knows how to do this?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>To generate the form I do:</p>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class AttributeForm(forms.Form):  
      def __init__(self, *args, **kwargs):
          extra = kwargs.pop('extra')
          super(AttributeForm, self).__init__(*args, **kwargs)
  
          for key in extra:
              self.fields[key] = forms.CharField(label=key, initial=extra[key], required=False)
              self.fields['delete_'+key] = forms.BooleanField(label='', required=False)
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>attribute_form = AttributeForm(extra=user)
  return render_to_response('user.html', {'username': username, 'attribute_form': attribute_form})
  </code></pre>
  
  <p><strong>template (user.html)</strong></p>
  
  <pre><code>&lt;form action="" method="post"&gt;
      &lt;table&gt;{{ attribute_form.as_table }}&lt;/table&gt;
      &lt;input type="submit" value="Save attributes"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>My template ended up like this:</p>
  
  <pre><code>    &lt;form action="" method="post"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  {% for field in attribute_form %}
                      {% cycle '&lt;th&gt;' '' %}{% cycle field.label_tag '' %}{% cycle '&lt;/th&gt;' '' %}
                      &lt;td&gt;{{ field }}{{ attribute_form.field.errors }}&lt;/td&gt;
                      {% if not forloop.last %}{% cycle '' '&lt;/tr&gt;&lt;tr&gt;' %}{% endif %}
                  {% endfor %}
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;input type="submit" value="Save attributes"&gt;
      &lt;/form&gt;
  </code></pre>