From 7a97db1e36a2dc327eea9f73d76a49efbcbf1d74 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Jun 2011 09:37:36 -0600 Subject: [PATCH] MOBI Output: Set the border attribute on tables if the CSS has border or border-width defined. --- src/calibre/ebooks/mobi/mobiml.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/mobiml.py b/src/calibre/ebooks/mobi/mobiml.py index 2275552c15..493767e233 100644 --- a/src/calibre/ebooks/mobi/mobiml.py +++ b/src/calibre/ebooks/mobi/mobiml.py @@ -442,9 +442,12 @@ class MobiMLizer(object): if tag in TABLE_TAGS and self.ignore_tables: tag = 'span' if tag == 'td' else 'div' - # GR: Added 'width', 'border' and 'scope' + if tag == 'table': + css = style.cssdict() + if 'border' in css or 'border-width' in css: + elem.set('border', '1') if tag in TABLE_TAGS: - for attr in ('rowspan', 'colspan','width','border','scope'): + for attr in ('rowspan', 'colspan', 'width', 'border', 'scope'): if attr in elem.attrib: istate.attrib[attr] = elem.attrib[attr] if tag == 'q':