Hi Jason,
Here are some pointers and some untested sample code. This is
Karrigell specific.
- Read the section on HTMLTags in the Karrigell reference
- Note how you can use the sum function to concatenate HTMLTag objects
- Have a look at the Karrigell demo apps and look at the code of any
app that produces tables
With HTMLTags you should be able to do something like this (completely
untested.) This will produce a table with table headings and with one
line per record.
keys = ['CustomerID','CompanyName','Address','City','Postal
Code','Country','Phone','Fax']
lines = TR(sum([TH(k) for k in keys]))
for record in records:
line += TR(sum([TD(record[k]) for k in keys]))
print TABLE(lines)
If you want format just one record, you could do something like this:
keys = ['CustomerID','CompanyName','Address','City','Postal
Code','Country','Phone','Fax']
print TABLE(sum([TR(TD(k) + TD(record[0][k]) for k in keys]))
In either case you can add, remove or change the order of the fields
simply by editing the keys list.
I am a bit rusty, so some things may not be quite right. None the less
it will give you something to start with.
Cheers,
Jim