Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#3112 closed enhancement (fixed)

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

Reported by: Brantley Owned by: Adrian Holovaty
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: no UI/UX: no


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 by Brantley <deadwisdom@…>, 17 years ago

Also the error row should have class='error'

comment:2 by Adrian Holovaty, 17 years ago

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

comment:3 by Xian, 17 years ago

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 by Brantley, 17 years ago

Ah yes, th and td would be good.

comment:5 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

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

comment:6 by Adrian Holovaty, 17 years ago

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

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