from typing import List


def format_row(columns: List[str], widths: List[int]) -> str:
    """Format one row of the table. This may go into multiple lines if
    any of the columns were wrapped."""
    row = ""
    had_values = True
    lineno = 0
    while had_values:
        had_values = False
        line = ""
        for (i, c) in enumerate(columns):
            collines = c.split("\n")
            if len(collines) > lineno:
                had_values = True
                line += "| " + collines[lineno] + " "
            else:
                line += "|" + " " * (2 + widths[i])
        if had_values:
            row += line + "|\n"
            lineno += 1
    return row[0:-1]