Exports data as an HTML table document.
Writes a complete HTML5 document with a <table> element containing <thead> for column headers and <tbody> for data rows. Simple inline CSS is included for readability (borders, padding, alternating row colours). All values are HTML-escaped to prevent XSS injection.
html (Python stdlib, no external dependency)from ObjDataExportHtml import ObjExportApi
exporter = ObjExportApi()
exporter.OpenFile("/tmp/output.html")
exporter.WriteHeader(["Name", "Score"])
exporter.WriteData([["Alice", 95], ["Bob", 82]])
exporter.CloseFile()
| Method | Description |
|---|---|
OpenFile(filename) |
Open file and write HTML preamble |
WriteHeader(fields) |
Write <thead> section with <th> cells |
WriteData(data) |
Write <tr>/<td> rows with redaction and escaping |
CloseFile() |
Close </table>, </body>, </html> tags |
EscapeCSV(val) |
HTML-escapes the value |
DefaultExtension() |
Returns "html" |