mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix html: a width of table was ignored on HTML builder (ref: #6564)
This commit is contained in:
parent
3b6b3e5801
commit
49063aa4eb
1
CHANGES
1
CHANGES
@ -23,6 +23,7 @@ Bugs fixed
|
||||
* #7368: C++, comma operator in expressions, pack expansion in template
|
||||
argument lists, and more comprehensive error messages in some cases.
|
||||
* C, C++, fix crash and wrong duplicate warnings related to anon symbols.
|
||||
* #6564: html: a width of table was ignored on HTML builder
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -734,11 +734,14 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
|
||||
|
||||
self._table_row_index = 0
|
||||
|
||||
atts = {}
|
||||
classes = [cls.strip(' \t\n') for cls in self.settings.table_style.split(',')]
|
||||
classes.insert(0, "docutils") # compat
|
||||
if 'align' in node:
|
||||
classes.append('align-%s' % node['align'])
|
||||
tag = self.starttag(node, 'table', CLASS=' '.join(classes))
|
||||
if 'width' in node:
|
||||
atts['style'] = 'width: %s' % node['width']
|
||||
tag = self.starttag(node, 'table', CLASS=' '.join(classes), **atts)
|
||||
self.body.append(tag)
|
||||
|
||||
def visit_row(self, node: Element) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user