-1

Following show my python return:

 return render(request,'school\Views\Spredictions.html'{'len':length,'final':Ol_result,'data':marks_sheet})

Here, final : - ['pass','pass',''fail,'fail'] like this

following show the my html code

                         <tbody>

                            {%for m in data%}
                                    <tr>
                                        <td>{{m.student_name}}</td>

                                        <td>{{final}}</td>

                                      </tr>
                                  {%endfor%}

                                </tbody>

I want to show one by one value in table interface, but show like that

output of table

How to solve this problem. Any one can help me Thank you

1 Answers1

0

I created a list using zip()

mylist1 = zip(student_name1,Ol_result)
return render(request,'school\Views\Spredictions.html',{'mylist':mylist1,'final':Ol_result,'data':marks_sheet})

Html code

  <tbody>
        {%for item1, item2 in mylist%}
            <tr>
                <td>{{item1}}</td>
                 <td>{{item2}}</td>

              </tr>
           {%endfor%}
</tbody>

Problem solved