(* * val mkHtmlTable : ('a list * 'b list) -> ('a -> string * 'b -> string) * -> (('a * 'b) -> string) -> string * The int list is list of colums, the function returns the values * at a given colum and row. * returns the HTML code of the generated table. *) fun mkHtmlTable (columns, rows) (rowToStr, colToStr) values = let val text = ref "
| " in (* Add headers *) map (fn colum => text := !text ^ " | " ^ (colToStr colum) ^ " | ") columns; text := !text ^ "
|---|---|
| " ^ (rowToStr row) ^ " | "; (* data *) map (fn col => text := !text ^ "" ^ (values (row, col)) ^ " | ") columns; text := !text ^ "