calculating width of a table row using offset right

calculating width of a table row using offset right

hi all,
i have a table row, in which there are three elements:
a textfield, a button and a drop down box.

now i am showing a div on a button click with the width equal to the total width of all these elements. but, in my system, monitor resolution is low; 800 * 600.  and when i set the width of the div, its reached till half of the drop down box.


but on high resolution in other monitors, the alignment of the div is correct. i have checked it till 1280 * 1024.

i want to know the reason of this change in width

here are the offset code

var rightoffset = $("#paramType").offset().left+$("#paramType").width();      // calculate the right offset of param drop down element

var offset = $("#param").offset();           // offset object for textfield element

$("#frame").css('width', (rightoffset - offset.left));          // set width of the div.

any one can point out the problem here??