locked
Not getting output with cycle tag in django? RRS feed

  • Question

  • I am attempting my hand on cycle tag of Django, however, when I utilize the beneath code the yield isn't of course ``` 

    <style> 

    .row1{ 

    color:blue; 



    .row2 { 

    color:green; 



    </style> 

    </head> 

    <body> 

    <h1> this is a world</h1> 

    <p> which is </p> 

    <p> 

    {% for o in list %} 

    <tr class="{% cycle 'row1' 'row2' %}"> 

    </br> 

    </tr> 

    {% endfor %} 

    </p> 

    </body> 

    ``` 

    I got the yield as dark content rather than shaded content since I make the classes row1 and row2 as blue and green individually. where am I missing the point?

    for any suggestions

    Thursday, December 14, 2017 11:25 AM

Answers