def decorate_table(table_text, convert_fun, d_cols=" & ", d_rows="\\\\\n"):
    """Transforms text of the table by applying converter function to each element of this table.

    :param table_text: (str) text of the table.
    :param convert_fun: (str => str) a function to be applied to each element of the table.
    :param d_cols: (str) delimiter between columns.
    :param d_rows: (str) delimiter between rows.
    :return: (str) text of the converted table.
    """
    def process_cell(s):
        return str(convert_fun(s))
    if d_cols not in table_text:
        return table_text # delimiter was not present

    splitted = table_text.split(d_cols)
    new_text = ""
    for i in range(0, len(splitted)):
        s = splitted[i]
        last_in_row = d_rows in s
        if last_in_row:
            two_elems = s.split(d_rows)
            decorated = process_cell(two_elems[0]) + d_rows
            if len(two_elems) > 1 and two_elems[1] != '':
                decorated += process_cell(two_elems[1])
        else:
            decorated = convert_fun(s)

        new_text += decorated
        if i < len(splitted)-1:
            new_text += d_cols
    return new_text