From 377e08477c8dce941b2d1504899123274e0c3e80 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 5 Jul 2014 19:45:24 +0100 Subject: Add conversion of tables to HTML --- lib/documents.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'lib/documents.js') diff --git a/lib/documents.js b/lib/documents.js index 86e0709..a781bbd 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -7,7 +7,10 @@ var types = { hyperlink: "hyperlink", footnoteReference: "footnoteReference", image: "image", - footnote: "footnote" + footnote: "footnote", + table: "table", + tableRow: "tableRow", + tableCell: "tableCell" }; function Document(children, options) { @@ -106,6 +109,27 @@ function Image(options) { }; } +function Table(children) { + return { + type: types.table, + children: children + }; +} + +function TableRow(children) { + return { + type: types.tableRow, + children: children + }; +} + +function TableCell(children) { + return { + type: types.tableCell, + children: children + }; +} + exports.Document = Document; exports.Paragraph = Paragraph; exports.Run = Run; @@ -116,3 +140,6 @@ exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.Image = Image; +exports.Table = Table; +exports.TableRow = TableRow; +exports.TableCell = TableCell; -- cgit v1.2.3