project_report/project_report_latex.py
def _limit_cell_width(rows, cell_widths):
        """
        Limit the size of the text in the cells of specific columns.
        When a cell has more characters than the limit, insert a new line.
        It can only insert one new line.
        :param rows: all rows of the table.
        :param cell_widths: a dict where the key is the column number (starting from 0) and
                            the value is the max number of character on one line
        :return: new rows modified if the character limit was reached.
        """
        new_rows = []
        for row in rows:
            new_row = []
            new_rows.append(new_row)
            for i, cell in enumerate(row):
                if i in cell_widths and len(str(cell)) > cell_widths.get(i):
                    new_row.append(
                        str(cell)[:cell_widths[i]] + '\n' + str(cell)[cell_widths.get(i):]
                    )
                else:
                    new_row.append(cell)
        return new_rows

        Limit the size of the text in the cells of specific columns.
        When a cell has more characters than the limit, insert a new line.
        It can only insert one new line.
        :param rows: all rows of the table.
        :param cell_widths: a dict where the key is the column number (starting from 0) and
                            the value is the max number of character on one line
        :return: new rows modified if the character limit was reached.
        
Limit the size of the text in the cells of specific columns.
When a cell has more characters than the limit, insert a new line.
It can only insert one new line.
Limit the size of the text in the cells of specific columns . When a cell has more characters than the limit insert a new line . It can only insert one new line .
def _limit_cell_width(rows, cell_widths):
        new_rows = []
        for row in rows:
            new_row = []
            new_rows.append(new_row)
            for i, cell in enumerate(row):
                if i in cell_widths and len(str(cell)) > cell_widths.get(i):
                    new_row.append(
                        str(cell)[:cell_widths[i]] + '\n' + str(cell)[cell_widths.get(i):]
                    )
                else:
                    new_row.append(cell)
        return new_rows
def _limit_cell_width ( rows , cell_widths ) : new_rows = [ ] for row in rows : new_row = [ ] new_rows . append ( new_row ) for i , cell in enumerate ( row ) : if i in cell_widths and len ( str ( cell ) ) > cell_widths . get ( i ) : new_row . append ( str ( cell ) [ : cell_widths [ i ] ] + '\n' + str ( cell ) [ cell_widths . get ( i ) : ] ) else : new_row . append ( cell ) return new_rows
Limit the size of the text in the cells of specific columns.
Limit the size of the text in the cells of specific columns .
"""
        Limit the size of the text in the cells of specific columns.
        When a cell has more characters than the limit, insert a new line.
        It can only insert one new line.
        :param rows: all rows of the table.
        :param cell_widths: a dict where the key is the column number (starting from 0) and
                            the value is the max number of character on one line
        :return: new rows modified if the character limit was reached.
        """
new rows modified if the character limit was reached.
new rows modified if the character limit was reached .
rows
all rows of the table.
all rows of the table .
cell_widths
a dict where the key is the column number (starting from 0) and
the value is the max number of character on one line
a dict where the key is the column number ( starting from 0 ) and the value is the max number of character on one line