I have a list in a CGI file as follows:
my_list = [apple, oranges, grapes, berries]
I want to iterate through this list in my html code. So far I have this:
<SCRIPT Language="JavaScript">
<!--
document.write('<table border="0" cellspacing="0">')
for(i=0; i <= %d; i++) {
document.write('<tr height="50">')
for (j=0; j <3; j++) {document.write('<td width="250" align="center" style="border- top-style:none;border-right-style:none;border-left-style:none;border-bottom- style:solid;border-width:1px;border-color:black;"> '+%s+ '</td>')}
document.write('</tr>')
}
document.write('</table>')
//-->
</SCRIPT>
...
</html>'''%(len(my_list), my_list)
for each column this prints out apple, oranges, grapes, berries | apple, oranges, grapes, berries and etc.
I want this to print out for the first column
- apple
- oranges
- grapes
- berries
Then I have another list for the second column and another list for the third column