def format_table(table, format_str):
    """Format a list of strings with a specific format. Recursively apply on lists within lists.

    :param list table: the list of string to format.
    :param str format_str: the format to use for the strings.

    :returns: the formatted list.

    """
    ret = []
    for t in table:
        if type(t) is list:
            ret.append(format_table(t, format_str))
        else:
            ret.append(format_str.format(t))
    return ret