I have a multiple choice field, something like this:
ft = forms.ModelMultipleChoiceField(widget=forms.CheckboxSelectMultiple)
which can have any no. of options. The problem is those do not display in an aligned manner but rather are done randomly and look clumsy. This messes up the whole look of the form. I am open for a django solution to this, probably by overriding the CheckboxSelectMultiple widget or even by adding a new class in CSS. I cannot change the .aligned in django/contrib/admin, as mentioned in some other site.. Thanks in advance.
This solved my issue..
We can add a CSS element[class or id] as below..
Now use the element
in the html file.
Here the main thing is
You can set the width as you want depending on how many fields you need in a line. As I needed 3 I used 700 and 200, if u need only two you could use (say) 800 and 400.
Let me know if this works for you, or you have a better way than this 🙂