I would like to make a form with this kind of grid :

Do you know how I can do this ? Is there a Django Form widget for that ?
Actually it is questions with the same choices list displayed as radio in a grid.
Thanks,
Natim
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d do this with a django form with one field per line on your grid, with a ChoiceField and RadioSelect as widget:
Then you need to find the template layout to render this correctly.
RadioSelectgenerates a<ul>with eahc choice being a<li>. The choice label is included in the<li>, which is not what you want here.With floppyforms you could subclass
RadioSelectand give it a cutom template_name (look at thefloppyforms/radio.htmltemplate) to omit the labels. You can also alter it to render, say, table cells (<td>s) instead of<li>, and make your form markup generate a table with the labels in the table’s header.Put your desired row markup in the above template.
Then, in the template that renders your form:
Then it’s only a matter of applying a couple of CSS styles to get the layout you need 🙂