html - How do I create this div id? -


I am trying to create a django template generated table.

How can I do this?

  & lt; Div id = "holder" onclick = "dostuff ()" & gt; & Lt; Table id = "table" bgcolor = "{{c.color_hash}}" & gt; & Lt; Tbody & gt; {& Amp; For S. xnum_rows & amp;} & lt; Tr id = "r" & gt; {& Amp; S.num_columns for Y & amp;} & lt; Td id = "c" height = '{{s.height}}' width = '{{s.width}}' & gt; & Lt; / Td> {& Amp; Endorph & amp;} & lt; / Tr & gt; {& Amp; Endorph & amp;} & lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt;  

Where & lt; Tr id = "r" & gt; from X to {& amp; For x in s.num_rows & amp;} .

I know that id should be of value for loop

Any clue?

Thanks

Burhan Khalid used {{x}} but templates Walking in does not work in this way. "Take a look at these template filters and tags, none of which is enough to be included in your application.

Compared to other solutions, ) It is, that once installed, it will always be available for your templates and template authors without passing a valid threshold through your visual code. "

Once you get the "get_range" filter, you can write your code like this:

  & lt; Div id = "holder" onclick = "dostuff ()" & gt; & Lt; Table id = "table" bgcolor = "{{c.color_hash}}" & gt; & Lt; Tbody & gt; {% Get_range (s.num_rows)%} for & lt; Tr id = "{{x}}" & gt; {% Get_range (s.num_columns)%} for & lt; Td id = "c" height = '{{s.height}}' width = '{{s.width}}' & gt; & Lt; / Td> {% Endfor%} & lt; / Tr & gt; {% Endfor%} & lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt;  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -