def reformat_table_list(table):
    cols_num = max([len(row) for row in table])
    cols_length = _get_cols_length(table, cols_num)

    new_table = []
    for row in table:
        new_row = []
        if not SEPARATOR_PATTERN.match(row[0]):
            for i in range(cols_num):
                try:
                    col = row[i]
                    new_row.append(col + " " * (cols_length[i] - len(col)))
                except:
                    new_row.append(" " * cols_length[i])
        else:
            marker = row[0][1]
            for i in range(cols_num):
                new_row.append(marker * (cols_length[i] + 2))
            # Add a mark for recognization
            new_row[0] = "+" + new_row[0]
        new_table.append(new_row)
    return new_table
Reformat & align the table list.
dataset/ETHPy150Open demon386/SmartMarkdown/table.py/reformat_table_list