Open
Description
In the member function of Table._Cell
def add_table(self, rows, cols):
"""Return a table newly added to this cell after any existing cell content,
having `rows` rows and `cols` columns.
An empty paragraph is added after the table because Word requires a paragraph
element as the last element in every cell.
"""
width = self.width if self.width is not None else Inches(1)
table = super(_Cell, self).add_table(rows, cols, width)
self.add_paragraph()
It would be nice if this function can support a style parameter.
Now we have to write code like this:
word_table = cell.add_table(rows=0, cols=num_cols)
word_table.autofit = True
word_table.style = 'Table Grid'
What we want is :
word_table = cell.add_table(rows=0, cols=num_cols, style = 'Table Grid')
word_table.autofit = True
which would be consistent with the Document class