开发者

jQuery outerWidth on a parent element which has child elements with padding

I have a slight issue, i am trying to get the outer width of a table cell. The table cell has some inputs as child elements, in this case a textbox and an image.

The width of the image is 16px and the width on the textbox is 115px. The textbox also has padding left and right, both 2px (equals 4px).

I would assume that td.outerWidth() gives me 119 + 16 = 135px (115 + 4 padding + 16) but instead it gives me 115 + 16 = 131px.

Outer width do return the correct width on all child elements separatly but there 开发者_Go百科seems to be problems when calculating the outer width on a parent element which has child elements with padding. If i remove the padding, then everything works fine.

Does anyone else have this problem or any solution to it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜