0
爲什麼Django表單顯示爲表格?我沒有將任何表格定義爲顯示。爲什麼Django的表格顯示爲表格?
from django import forms
class FieldForm(forms.Form):
field = forms.CharField(label='Field:', max_length=32)
<form action="" method="get">
{{ form }}
<input type="submit" value="Submit" />
</form>
output:
<tr><th><label for="id_field">Field:</label></th><td><input id="id_field" maxlength="32" name="field" type="text" required /></td></tr>