RosettaCodeData/Task/Create-an-HTML-table/Lasso/create-an-html-table.lasso

22 lines
489 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
define rand4dig => integer_random(9999, 1)
local(
2026-02-01 16:33:20 -08:00
output = '<table border=2 cellpadding=5 cellspace=0>\n<tr>'
2023-07-01 11:58:00 -04:00
)
with el in ('&#160;,X,Y,Z') -> split(',') do {
2026-02-01 16:33:20 -08:00
#output -> append('<th>' + #el + '</th>')
2023-07-01 11:58:00 -04:00
}
#output -> append('</tr>\n')
loop(5) => {
2026-02-01 16:33:20 -08:00
#output -> append('<tr>\n<td style="font-weight: bold;">' + loop_count + '</td>')
loop(3) => {
#output -> append('<td>' + rand4dig + '</td>')
}
#output -> append('</tr>\n')
2023-07-01 11:58:00 -04:00
}
#output -> append('</table>\n')
#output