En Mon, 18 Aug 2008 09:05:30 -0300, Adrian Smith <[EMAIL PROTECTED]> escribió:
> On Aug 18, 7:16 pm, Amie <[EMAIL PROTECTED]> wrote: >> Afternoon all. >> >> Just want to know how to create html tables using a for loop. >> I need to display 34 html tables, so I figured a for loop will do. >> Please show me an example of how to do that. > > for i in range(33): > print "<table border>" > for j in range(numberofrows-1): > print "<tr><td>stuff</td><td>stuff</td><td>stuff</td></tr>" > print "</table>" > > Or something like that. You could have for loops for the individual > rows, too. This can be done, but easily becomes unmaintainable. I'd use a template engine - or at least a library for generating HTML. See this recent thread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/950811516b29fcc/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list