def _squeeze(lines, width):
    """
    Squeeze the contents of a cell into a fixed width column, breaking lines on spaces where possible.

    :param lines: list of string lines in the cell
    :param width: fixed width of the column
    :return: list of lines squeezed to fit
    """
    if all(len(line) <= width for line in lines):
        return lines
    out = []
    token_lines = [line.split(" ") for line in lines]
    for token_line in token_lines:
        line = []
        for token in token_line:
            if sum(len(token) for token in line) + len(token) + len(line) > width:
                if line:
                    out.append(" ".join(line))
                while len(token) > width:
                    out.append(token[:width])
                    token = token[width:]
                line = [token]
            else:
                line.append(token)
        out.append(" ".join(line))
    return out