MOBI Output: Set the border attribute on tables if the CSS has border or border-width defined.

This commit is contained in:
Kovid Goyal 2011-06-13 09:37:36 -06:00
parent cab4eb9bd2
commit 7a97db1e36

View File

@ -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':