on htmlTable (data) str = "" -- table head put "" after str repeat with cell in data[1] put "" after str end repeat put "" after str -- table body put "" after str cnt = data.count repeat with i = 2 to cnt put "" after str repeat with cell in data[i] put "" after str end repeat put "" after str end repeat put "" after str put "
 "&cell&"
"&(i-1)&""&cell&"
" after str return str end