In these kinds of situations you're better off using absolute positioning for the optional column. Top right of the parent should be top left of the pop-up.
Height wise these are standard CSS issues. Somewhere there will have to be a static height on a parent container so that you may use % in child divs. If all heights change, then you'll have to use javascript. Coding height setters is fairly trivial.
You might need to provide more info as to what you're trying to do here.