Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

jinja table template

<table>
{% for item in items %}
<TR>
   <TD class="c1"><IMG src="favicon.ico"></TD>
   <TD class="c2">{{item.date}}</TD>
   <TD class="c3">{{item.id}}</TD>
   <TD class="c4"><SPAN>{{item.position}}</SPAN></TD>
   <TD class="c5"><SPAN>{{item.status}}</SPAN></TD>
</TR>
{% endfor %}
</table>
Comment

jinja templates tables

<table>
{% for item in items %}
<TR>
   <TD class="c1"><IMG src="favicon.ico"></TD>
   <TD class="c2">{{item.date}}</TD>
   <TD class="c3">{{item.id}}</TD>
   <TD class="c4"><SPAN>{{item.position}}</SPAN></TD>
   <TD class="c5"><SPAN>{{item.status}}</SPAN></TD>
</TR>
{% endfor %}
</table>
Comment

tables in jinja template

items = []
for i in range(1, 11):
    i = str(i)

    # dict == {}
    # you just don't have to quote the keys
    an_item = dict(date="2012-02-" + i, id=i, position="here", status="waiting")
    items.append(an_item)

# ... your code here ...

template.render(items=items)
Comment

PREVIOUS NEXT
Code Example
Python :: speech enhancement techniques 
Python :: timedelta format python 
Python :: textrank python implementation 
Python :: changes in settings.py for media storage without db 
Python :: how to split a string by space in python 
Python :: explode function in python 
Python :: numpy.sort 
Python :: python power of natural number 
Python :: euclidean distance 
Python :: space complexity python 
Python :: keys function in python 
Python :: print() function in python 
Python :: Excel file format cannot be determined, you must specify an engine manually 
Python :: python print not working 
Python :: fibonacci sequence 
Python :: torch.utils.data.random_split(dataset, lengths) 
Python :: cosine similarity numpy 
Python :: how to print second largest number in python 
Python :: merge sort function 
Python :: print list of list line by line python 
Python :: nlp spacy medium 
Python :: youtube mp3 downloader python 
Python :: print all objects in list python 
Python :: dictionary with list as values 
Python :: Ignoring invalid distribution -ip (c:python310libsite-packages) 
Python :: is the multiply code in python 
Python :: get min of list python 
Python :: python string and integer concatenation 
Python :: add new element to python dictionary 
Python :: create a virtual environment python 3 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =