many updates in report code and in storage structure, this commit is broken
diff --git a/wally/html.py b/wally/html.py
index e92e7d1..553aff5 100644
--- a/wally/html.py
+++ b/wally/html.py
@@ -1,2 +1,44 @@
-def img(link):
+from typing import Optional, List, Callable
+
+
+import xmlbuilder3
+
+
+eol = "<br>"
+
+
+def tag(name: str) -> Callable[[str], str]:
+ def closure(data: str) -> str:
+ return "<{}>{}</{}>".format(name, data, name)
+ return closure
+
+
+H3 = tag("H3")
+H2 = tag("H2")
+center = tag("center")
+
+
+def img(link: str) -> str:
return '<img src="{}">'.format(link)
+
+
+def table(caption: str, headers: Optional[List[str]], data: List[List[str]]) -> str:
+ doc = xmlbuilder3.XMLBuilder("table",
+ **{"class": "table table-bordered table-striped table-condensed table-hover",
+ "style": "width: auto;"})
+
+ doc.caption.H3.center(caption)
+
+ if headers is not None:
+ with doc.thead:
+ with doc.tr:
+ for header in headers:
+ doc.th(header)
+
+ with doc.tbody:
+ for line in data:
+ with doc.tr:
+ for vl in line:
+ doc.td(vl)
+
+ return xmlbuilder3.tostr(doc).split("\n", 1)[1]
\ No newline at end of file