Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
41
Task/Create-an-HTML-table/Oz/create-an-html-table.oz
Normal file
41
Task/Create-an-HTML-table/Oz/create-an-html-table.oz
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
declare
|
||||
|
||||
[Roads] = {Module.link ['x-ozlib://wmeyer/roads/Roads.ozf']}
|
||||
|
||||
fun {Table Session}
|
||||
html(
|
||||
head(title("Show a table with row and column headings")
|
||||
style(type:"text/css"
|
||||
css(td 'text-align':center)
|
||||
))
|
||||
body(
|
||||
{TagFromList table
|
||||
tr(th th("X") th("Y") th("Z"))
|
||||
|
|
||||
{CreateRows 3 5}
|
||||
}))
|
||||
end
|
||||
|
||||
fun {CreateRows NumCols NumRows}
|
||||
{List.map {List.number 1 NumRows 1}
|
||||
fun {$ Row}
|
||||
{TagFromList tr
|
||||
td( {Int.toString Row} )
|
||||
|
|
||||
{List.map {List.number 1 NumCols 1}
|
||||
fun {$ Col}
|
||||
SequentialNumber = (Row-1)*NumCols + Col
|
||||
in
|
||||
td( {Int.toString SequentialNumber} )
|
||||
end
|
||||
}}
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
TagFromList = List.toTuple
|
||||
|
||||
in
|
||||
|
||||
{Roads.registerFunction table Table}
|
||||
{Roads.run}
|
||||
Loading…
Add table
Add a link
Reference in a new issue