def maxcol_change(opts, collength, scrmax, dval):
    """ Change the value of maximum column width """
    if opts.colwidth + dval < 1:
        return opts
    if opts.colwidth + dval > scrmax - 2:
        return opts
    if opts.colwidth + dval > max(collength):
        return opts
    opts.colwidth = opts.colwidth + dval
    return opts
