[FIX] rendering of tables with merged cells

Merged cells in the first columns were not rendered correctly and values from
other columns would be placed in the wrong columns.
This commit is contained in:
Xavier Morel 2020-02-14 10:57:36 +01:00 committed by Antoine Vandevenne (anv)
parent 1081f8b7b5
commit a60364a5e4

View File

@ -433,7 +433,12 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
tagname = 'th'
else:
tagname = 'td'
self.body.append(self.starttag(node, tagname))
attrs = {}
if 'morerows' in node:
attrs['rowspan'] = node['morerows']+1
if 'morecols' in node:
attrs['colspan'] = node['morecols']+1
self.body.append(self.starttag(node, tagname, **attrs))
self.context.append(tagname)
def depart_entry(self, node):
self.body.append(u'</{}>'.format(self.context.pop()))