Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3112 closed enhancement (fixed)

Newforms needs better CSS class-labels on elements of the output

Reported by: Brantley Owned by: adrian
Component: Forms Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


For CSS purposes, it would be excellent if the first <td>, containing
the label, had the class "label", and the second, containing the
field, had the class "field".

For instance, change:

<tr><td>Username:</td><td><input type="text" name="username" /></td></tr>

To this:

<tr><td class='label'>Username:</td><td class='field'><input type="text" name="username" /></td></tr>

Also, any row for a field that is required could have class='required'.

Change History (6)

comment:1 Changed 9 years ago by Brantley <deadwisdom@…>

Also the error row should have class='error'

comment:2 Changed 9 years ago by adrian

What about using <th> and <td> instead of classes?

comment:3 Changed 9 years ago by Xian

I like the idea of using <th>s for labels and <td>s for the fields.
+1 for error and required classes on the appropriate rows.

comment:4 Changed 9 years ago by Brantley

Ah yes, th and td would be good.

comment:5 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [4197]) Fixed #3112 -- Changed newforms Form.as_table() to use <th> instead of <td> for first column

comment:6 Changed 9 years ago by adrian

(In [4198]) Updated docs/newforms.txt to reflect [4197]. Refs #3112

Note: See TracTickets for help on using tickets.
Back to Top