On Sun, Jan 6, 2013 at 11:42 PM, Kurt Hansen <kurt@ugyldig.invalid> wrote: > Since there's only one "field" in the first line, I want this output: > > <tr><td colspan="3">Price table</td></tr> > > - insted of > > <tr><td>Price table</td></tr> > > How to? Thank you i advance.
It's actually quite simple, as long as you don't mind the junk of colspan="1" on all the other cells. Just replace the innermost loop with: for item in columns: output += '<td colspan="' + (4-len(columns)) + '"\>' + item + '</td\> ' Untested, but it ought to work - as long as you never have _more_ cells in the line. ChrisA -- http://mail.python.org/mailman/listinfo/python-list