Den 06/01/13 13.52, Chris Angelico skrev:
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.

I do, but I would like to test anyway ;-)

 Just replace the innermost loop
with:

         for item in columns:
                 output += '<td colspan="' + (4-len(columns)) + '"\>' +
item + '</td\> '

"innermost"? I have replaced this with yours, but all the marked text are deleted:

for item in columns:
                output += '<td\>' + item + '</td\> '

Untested, but it ought to work - as long as you never have _more_
cells in the line.
--
Regards
Kurt Hansen
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to