def render_row(num, columns, widths, column_colors=None):
    """
    Render the `num`th row of each column in `columns`.

    :param num: Which row to render.
    :type num: ``int``
    :param columns: The list of columns.
    :type columns: [[``str``]]
    :param widths: The widths of each column.
    :type widths: [``int``]
    :param column_colors: An optional list of coloring functions.
    :type column_colors: [``str`` -> ``str``] or ``NoneType``

    :return: The rendered row.
    :rtype: ``str``
    """
    row_str = '|'
    cell_strs = []
    for i, column in enumerate(columns):
        try:
            cell = column[num]
            spaces = ' ' * (widths[i] - len(cell))
            if column_colors is not None and column_colors[i] is not None:
                cell = column_colors[i](cell)
            cell_strs.append(' %s%s ' % (cell, spaces))
        except IndexError:
            cell_strs.append(' ' * (widths[i] + 2))
    return '|%s|' % '|'.join(cell_strs)
