epub converter: fix tables

This commit is contained in:
shirshasa
2021-06-01 17:55:06 +03:00
parent 684738e8a9
commit ac82fc5f4b

View File

@@ -95,13 +95,14 @@ def preprocess_table(body_tag: BeautifulSoup):
width = td.get('width') or width
td.attrs = {}
if width:
td.attrs['width'] = width
if border_sizes:
border_size = sum(border_sizes) / len(border_sizes)
table.attrs['border'] = f'{border_size:.2}'
else:
table.attrs['border'] = '1'
def _process_lists(body_tag):