#35070 closed Cleanup/optimization (invalid)
Default form output in docs is shown as as_table() instead of as_div()
| Reported by: | Zowie Beha | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 4.2 |
| Severity: | Normal | Keywords: | form, documentation |
| Cc: | Zowie Beha | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
https://docs.djangoproject.com/en/4.2/ref/forms/api/#outputting-forms-as-html
"This default output is a two-column HTML table, with a <tr> for each field."
"... <table> output is the default output style when you print a form ..."
The examples in this section show that if you print a form, it will render as an html table.
However, if I try the examples locally, the form is rendered as a series of div elements.
This leads me to think that the documentation doesn't reflect this new default.
I'm not sure when this default was introduced, but it might be ~Django version 4.1, as that is when as_div() was added.
Change History (5)
comment:1 by , 23 months ago
| Summary: | Default form output is shown as as_table() instead of as_div() → Default form output in docs is shown as as_table() instead of as_div() |
|---|
comment:2 by , 23 months ago
| Type: | Bug → Cleanup/optimization |
|---|
comment:3 by , 23 months ago
| Cc: | added |
|---|
follow-up: 5 comment:4 by , 23 months ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
| Version: | 5.0 → 4.2 |
comment:5 by , 23 months ago
Replying to Mariusz Felisiak:
These docs are correct for Django 4.2.
<div>became the default form rendering style when outputting a form in Django 5.0, check out release notes.
Oops! Thank you, I didn't notice the link was for 4.2 instead of 5.0
These docs are correct for Django 4.2.
<div>became the default form rendering style when outputting a form in Django 5.0, check out release notes.