开发者

jQuery UI issues with tables in dialogs

开发者 https://www.devze.com 2023-04-09 10:24 出处:网络
I have a jQuery UI dialog to which I applied a padding, and inside the dialog I have a long table. I then configure the dialog to be of limited height in order to have a scrollbar.

I have a jQuery UI dialog to which I applied a padding, and inside the dialog I have a long table. I then configure the dialog to be of limited height in order to have a scrollbar.

It seems that whenever a nowrap is applied to the table cells, the padding to the right of the table is covered by the scrol开发者_开发问答lbar. If I remove the nowrap, it works fine.

Here is an editable example:

http://jsbin.com/okolap/4/edit


It seems that it only happens when you set the dialog's width to auto.

One workaround is to set the table's width to 100% and reset the dialog's width to a fixed length. The length needs to add a padding equal or larger than the width of the scroll bar. For example:

var newWidth = $('.Dialog').width() + 50;
$('.Dialog').width(newWidth);

See this in action: http://jsbin.com/okolap/10/.

0

精彩评论

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