Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
25
Task/Create-an-HTML-table/Lingo/create-an-html-table-1.lingo
Normal file
25
Task/Create-an-HTML-table/Lingo/create-an-html-table-1.lingo
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
on htmlTable (data)
|
||||
str = "<table>"
|
||||
|
||||
-- table head
|
||||
put "<thead><tr><th> </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
|
||||
12
Task/Create-an-HTML-table/Lingo/create-an-html-table-2.lingo
Normal file
12
Task/Create-an-HTML-table/Lingo/create-an-html-table-2.lingo
Normal 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>"
|
||||
Loading…
Add table
Add a link
Reference in a new issue