def join_lines(columns, separator=''):
    """Joins an arbitrary number of multi-line strings side-by-side splitting on
    the '\n' character. It pads the ends of lines with ' ' characters as needed
    to preserve alignment.

    Args:
        columns: List of multi-line strings to join.
        separator: Padding inserted between each column.
    """
    split_columns = [x.split('\n') for x in columns]

    # Max line width for each input column.
    widths = [max(x) for x in [[len(y) for y in z] for z in split_columns]]

    result = ''
    for i in range(max([len(x) for x in split_columns])):
        for j, column in enumerate(split_columns):
            result += ('{:<' + str(widths[j] + len(separator)) + '}').format(
                '' if i > len(column) - 1 else column[i])

        result += '\n'
    return result