On Friday 05 May 2017 06:17:12 guettli wrote: > Am Donnerstag, 4. Mai 2017 16:03:25 UTC+2 schrieb Todor Velichkov: > > Take a look at: > > 1) Form rendering options > > <https://docs.djangoproject.com/en/1.11/topics/forms/#form-rendering > > -options> 2) Outputting forms as HTML > > <https://docs.djangoproject.com/en/1.11/ref/forms/api/#outputting-fo > > rms-as-html> > > > > {{ form }} and {{ form.as_table }} are basically the same. > > So in terms of valid markup <table>{{ form }}</table> would be more > > correct. > > OK, <table>{{ form }}</table> is what I do now. Somehow I am unsure > if this is really the best way.
There is never a best way. Only a best way for the job. Django's job is to provide sensible, workable defaults. Table, paragraph and list view are 3 common ways to render form elements. If you however use Bootstrap for css, you're much more helped by using the bootstrap3 package[1]. Example: <form method="POST"> {% csrf_token %} {% bootstrap_form form %} {% buttons submit='Go!' %}{% endbuttons%} </form> -- Melvyn Sopacua -------- [1] https://djangopackages.org/packages/p/django-bootstrap3/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9008764.HJ6FAVUOio%40devstation. For more options, visit https://groups.google.com/d/optout.