mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-20 15:44:15 +01:00
MOBI Output: Set the border attribute on tables if the CSS has border or border-width defined.
This commit is contained in:
parent
cab4eb9bd2
commit
7a97db1e36
1 changed files with 5 additions and 2 deletions
|
|
@ -442,9 +442,12 @@ def mobimlize_elem(self, elem, stylizer, bstate, istates,
|
|||
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':
|
||||
|
|
|
|||
Loading…
Reference in a new issue