From d893b8c9c61fcb4a6999e8b302ba8584321e554e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Apr 2015 09:52:08 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/docx/writer/tables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/writer/tables.py b/src/calibre/ebooks/docx/writer/tables.py index 21bef908fc..12bcfe2e5f 100644 --- a/src/calibre/ebooks/docx/writer/tables.py +++ b/src/calibre/ebooks/docx/writer/tables.py @@ -143,9 +143,10 @@ class Cell(object): if self.col_span > 1: makeelement(tcPr, 'w:hMerge', w_val='restart') + item = None for item in self.items: item.serialize(tc) - if isinstance(item, Table): + if item is None or isinstance(item, Table): # Word 2007 requires the last element in a table cell to be a paragraph makeelement(tc, 'w:p')