Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,25 @@
on htmlTable (data)
str = "<table>"
-- table head
put "<thead><tr><th>&nbsp;</th>" after str
repeat with cell in data[1]
put "<th>"&cell&"</th>" after str
end repeat
put "</tr></thead>" after str
-- table body
put "<tbody>" after str
cnt = data.count
repeat with i = 2 to cnt
put "<tr><td>"&(i-1)&"</td>" after str
repeat with cell in data[i]
put "<td>"&cell&"</td>" after str
end repeat
put "</tr>" after str
end repeat
put "</tbody>" after str
put "</table>" after str
return str
end

View file

@ -0,0 +1,12 @@
tableData = [\
["X", "Y", "Z"],\
["1", "2", "3"],\
["4", "5", "6"],\
["7", "8", "9"]\
]
htmlCode = htmlTable(tableData)
-- render the result in a text member (which only supports simple/ancient HTML)
m = new(#text)
m.text = "<html><body>"&htmlCode&"</body></html>"