Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can i reduce the spacing between checkboxes rendering in a django template?

I have retrived some data by retreival from database and saved in into variable DATA
`

def sendApproval(request):
    form = SendApp
    data = Profile.objects.filter(Admin="Lavanya")
    context = { "form": form,"data":data}
    return render(request, 'homePageHtml/SendApproval.html', context)

`
And then in the html templete I used that data to represent it as checkboxes

`

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

{%for a in data%}<br>
  <input type="checkbox" id="recommender" name="choosen" value="{{a.UserName}}" >
  <label for="recommender" style="font-size:15px"> {{a.UserName}}</label><br><br>
{%endfor%}

`

and after viewing it on web page it is visible like this:
I wanted to reduce the gap between these checkboxes

Any one with the solution will be appreciated! Thanks in advance

I tried:

`

.adjust-line-height {
  line-height: 1em;
}

`
adding this into my code, but this didn’t work….

>Solution :

I believe that you can reduce the < br > amount in the HTML part, something like:

{%for a in data%}<br>
<input type="checkbox" id="recommender" name="choosen" value="{{a.UserName}}" >
<label for="recommender" style="font-size:15px"> {{a.UserName}}</label><br>
{%endfor%}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading