Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -0,0 +1,31 @@
|
|||
on pad_table(s, char2)
|
||||
set opener to "<t" & char2 & ">"
|
||||
set closer to "</t" & char2 & ">"
|
||||
repeat with i from 1 to length of s
|
||||
set x to item i of s
|
||||
set item i of s to opener & x & closer
|
||||
end repeat
|
||||
return "<tr>" & s & "</tr>"
|
||||
end pad_table
|
||||
|
||||
on gen_row(n, ncols)
|
||||
set row to {n}
|
||||
repeat ncols times
|
||||
set row to row & (random number from 1 to 9999)
|
||||
end repeat
|
||||
return row
|
||||
end gen_row
|
||||
|
||||
on html_table(headings, nrows)
|
||||
set ncols to length of headings
|
||||
set theader to pad_table({""} & headings, "h")
|
||||
set tbody to {}
|
||||
repeat with i from 1 to nrows
|
||||
set tbody to tbody & pad_table(gen_row(i, ncols), "d")
|
||||
end repeat
|
||||
set out to {"<table>"} & theader & tbody & {"</table>"}
|
||||
set AppleScript's text item delimiters to linefeed
|
||||
return out as text
|
||||
end html_table
|
||||
|
||||
html_table({"X", "Y", "Z"}, 3)
|
||||
Loading…
Add table
Add a link
Reference in a new issue